Inspectopedia Help

Code style

Name

Language

'Closure::fromCallable()' can be converted to the first-class callable syntax  

PHP

'array_fill' can be converted to loop  

PHP

'array_filter()' call can be converted to loop  

PHP

'array_map()' call can be converted to loop  

PHP

'get_class()' call can be replaced with '::class'  

PHP

'if' can be replaced with 'match' expression  

PHP

'instanceof' checks in 'catch' block can be replaced with specific catches  

PHP

'isset' can be replaced with coalesce  

PHP

'isset' can check nested array access and sub properties directly  

PHP

'match' can be replaced with 'switch' statement  

PHP

'match' expression can be replace with ternary expression  

PHP

'mixed' return type can be narrowed  

PHP

'mixed' type can be replaced with 'array'  

PHP

'pow()' call can be replaced with '**' operator  

PHP

'readonly' modifier is redundant  

PHP

'str*()' calls can be replaced with PHP 8 'str_*()' calls  

PHP

'switch' can be replaced with 'match' expression  

PHP

Automatic conversion of 'false' to array is deprecated  

PHP

Case mismatch in method call or class usage  

PHP

Class can be 'readonly'  

PHP

Class constant can be 'final'  

PHP

Class path doesn't match project structure  

PHP

Closure can be converted to arrow function  

PHP

Comment can be replaced with named argument  

PHP

Control statement body without braces  

PHP

Dangerous array initialization  

PHP

Define constant name can be replaced with 'const' syntax  

PHP

Expression without clarifying parentheses  

PHP

Fully qualified name usage  

PHP

Implicit octal literal can be replaced with explicit one  

PHP

Loop can be converted to 'array_fill()' call  

PHP

Loop can be converted to 'array_filter()' call  

PHP

Loop can be converted to 'array_map()' call  

PHP

Method can be made 'static'  

PHP

Multiple 'isset' calls can be replaced with one  

PHP

Multiple classes declarations in one file  

PHP

Named arguments order does not match parameters order  

PHP

Nullsafe operator '?->' can be used  

PHP

Old style constructor  

PHP

Open 'echo' tag usage  

PHP

Redundant closing tag  

PHP

Short open 'echo' tag usage  

PHP

Short open tag usage  

PHP

Single-statement body with braces  

PHP

Traditional syntax array literal detected  

PHP

Trait usage is not allowed  

PHP

Trait use rule resolved to method with different containing class  

PHP

Type cast is unnecessary  

PHP

Type cast on a scalar value  

PHP

Type hint 'array|Traversable' can be replaced with 'iterable'  

PHP

Unnecessary curly braces syntax for variable  

PHP

Unnecessary double quotes  

PHP

Unnecessary fully qualified name  

PHP

Unnecessary leading '\' in 'use' statement  

PHP

Unnecessary parentheses  

PHP

Usage of a variable variable  

PHP

Variable is only used inside closure  

PHP

Last modified: 13 July 2023