MediaWiki-CodeSniffer
MediaWiki CodeSniffer Standards
|
Enforce use of ?MyClass $x
instead of MyClass $x = null
, which is (correctly) misinterpreted as optional by IDEs and static analysis tools.
More...
Public Member Functions | |
register () | |
@inheritDoc | |
process (File $phpcsFile, $stackPtr) | |
Enforce use of ?MyClass $x
instead of MyClass $x = null
, which is (correctly) misinterpreted as optional by IDEs and static analysis tools.
This is only done for nullable types followed by required parameters. Note that we don't offer an autofix, because changing a signature should be verified carefully.
MediaWiki\Sniffs\Usage\NullableTypeSniff::process | ( | File | $phpcsFile, |
$stackPtr ) |
File | $phpcsFile | File |
int | $stackPtr | Location |