1.2.821. No Need For get_class()¶
There is no need to call get_class() to build a static call. The argument of get_class() may be used directly.
<?php
//
$a->b::$c
// This is too much code
get_class($a->b)::$c
?>
See also Scope Resolution Operator (::).
1.2.821.1. Connex PHP features¶
1.2.821.1.1. Suggestions¶
Use get_called_class(), which may carry different class names
Use self, static or parent keywords, if you are already in the current class
Use the argument of get_class() directly
1.2.821.1.2. Specs¶
Short name |
Structures/NoNeedGetClass |
Rulesets |
|
Exakat since |
1.8.1 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Available in |