Skip to content
Permalink
Browse files

Update 010-code-style.md

  • Loading branch information...
samdark committed Oct 29, 2019
1 parent 5060ef5 commit 32b0622118f4066c8df56610b8cf9c11b92bb50c
Showing with 27 additions and 1 deletion.
  1. +27 −1 010-code-style.md
@@ -14,7 +14,33 @@ a workaround for a bug in a certain PHP version.

Method comment is necessary except it adds nothing to what method name and signature already has.

Class comment should describe the purpose of the class.
Class comment should describe the purpose of the class.

## No alignment

Property, variable and constant value assignments should not be aligned. Same applies to phpdoc tags.
The reason is that aligned statements often cause larger diff and even conflicts.

```php
class X
{
const A = 'test';
const BBB = 'test';
private $property = 42;
private $test = 123;
/**
* @param int $number just a number
* @param array $options well... options!
*/
public function doit(int $number, array $options)
{
$test = 123;
$a = 123;
}
}
```

## Additional conventions

0 comments on commit 32b0622

Please sign in to comment.
You can’t perform that action at this time.