Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 762 Bytes

no_useless_nullsafe_operator.rst

File metadata and controls

37 lines (27 loc) · 762 Bytes

Rule no_useless_nullsafe_operator

There should not be useless Null-safe operator ?-> used.

Examples

Example #1

--- Original
+++ New
 <?php
 class Foo extends Bar
 {
     public function test() {
-        echo $this?->parentMethod();
+        echo $this->parentMethod();
     }
 }

Rule sets

The rule is part of the following rule sets:

Source class

PhpCsFixer\Fixer\Operator\NoUselessNullsafeOperatorFixer