You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
attempt to lint PHP file with declare(strict_types=1) in it, that doesn't have types placed would result in an error
if developer then would add types to function declaration the FunctionDeclaration sniff mentioned before would check that they're also listed in PHPDoc
Probably modern IDE (e.g. PhpStorm) will already report missing types as error. If you're using build server adding a lint step would then fail the build if somebody commits such broken code.
It is possible to create following rules in php code sniffer?
For example:
Passes:
public function someMethod(SomeIntrerface $foo) : SomeIntrerface
Passes:
Do not pass:
public function someMethod($foo)
Pass:
Do not pass:
private $foo;
The text was updated successfully, but these errors were encountered: