Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
Added PHP naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
leevigraham committed Oct 25, 2013
1 parent 451cc05 commit 8e4c638
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions php.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
PHP / Symofny2 Stuff
====================

Code Style
----------

* Follow [Symonfy2](http://symfony.com/doc/current/contributing/code/standards.html) coding standards which follow [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md), [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) & [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
* 4 Spaces not Tabs
* https://github.com/opensky/Symfony2-coding-standard

Relationships
-------------

* Access major relationships through repository methods rather than getters.
* Smaller joins on initial object load
* Allows filtering on relationship
* Consider [preloading loading `many to one` and `one to one`](http://whitewashing.de/2013/02/19/extending_symfony2__paramconverter.html)

DocBlock / Annotations
----------------------

* Follow [Symonfy2](http://symfony.com/doc/current/contributing/code/standards.html)

### Exceptions

* Symonfy2 custom annotations are after the description / long description and before `@params`
* Symfony2 custom annotations are split with a line break and boundaried by blank lines

```php
/**
* Description
*
* Longer description
*
* @View(...)
* @Route(...)
*
* @param string $dummy Some argument description
* @param array $options
*
* @return string|null Transformed input
*
* @throws \RuntimeException
*/
```

0 comments on commit 8e4c638

Please sign in to comment.