Repository navigation
phrost 0.1.2
The linter
printf,sprintfandfprintfgiven an unpacked value --printf('%s %d', ...$row)-- are no
longer reported as missing arguments, and a call that really is short says how many values it was
given rather than repeating how many it needs.- A deprecation raised the way Symfony and Drupal ask for it,
@trigger_error('...', E_USER_DEPRECATED), is no longer reported as an unsafe use of@. Every
other silenced call still is. In Drupal core that was 368 of the rule's 483 findings. - The deprecation rules that need PHP 8.1 or later run: an implicitly nullable parameter, a class
named_,(integer)and the other long casts, acaseended by a semicolon, the backtick
operator, a reference returned from avoidfunction. They never had, because the linter was told
no PHP version and took 8.0. A deprecation is shown as a warning, and a rule that advises newer
syntax follows the oldest PHPcomposer.jsonrequires. assert-descriptionandsensitive-parameterare reported only where a project names them in
phrost.toml: the first objects toassert($x instanceof T), which the type checker narrows
through, and the second decides by a parameter's name.strict-behaviorasksbase64_decodefor strict decoding, where it said strict comparison.
The type checker
- A method an extension overloads, or declares differently for the library it was built against,
takes every form the extension does:Imagick::convolveImage()with a kernel object or a matrix,
setImageBluePrimary()and its siblings with two coordinates or three,IntlCalendar::set()with
a field and a value or a whole date. The stubs declared each twice and only the last counted, so
the other form was reported as a wrong or an extra argument.
Faster
- Diagnostics for a file of
define()calls, or any long run of calls taking literals: a 3317-line
stub file went from 145 ms to 6 ms. - Code actions in a file naming classes nothing declares, which is every file of a project before
composer install: at a cursor in Laravel's own tests, p95 from 1 489 ms to 19 ms. - A value handed to hundreds of calls in one function: 800 calls, from 335 ms to 53 ms.