Dmitry Patsura
Dmitry Patsura
``` php function test() { if ($a == 1) { return true; } return false; } ``` Need to be ``` php function test() { return ($a == 1); }...
``` php class A { public function(B $b = null) { if (!empty($b)) { } } } ```
Example to review ``` php class Test { /** * @return bool */ public function returnTrue() { $a = 5; $b = &$a; $a = 0; return 1 / $b;...
``` php $a = 1; unset($a); var_dump($a); // Undefined? ```
Maybe this will be helpfull to detect some bugs Super referenced variables after cycles or etc
Seems very epic task :)
``` php function ($a) { return $a(); } ``` Suggest ``` php function (callable $a) { ``` do the same for array and objects.
Run: `./bin/phpsa check src/` and try to fix notices. (or create a bug issue if it's a bug)
Example projects https://github.com/codeclimate/codeclimate-phpcodesniffer https://github.com/codeclimate/cc-php-test-reporter-sandbox @todo need more info