PHPSA\Variable::isUnused PHP Method

isUnused() public method

Check if you are setting values to variable but didn't use it (means get)
public isUnused ( ) : boolean
return boolean
    public function isUnused()
    {
        return $this->gets == 0 && $this->sets > 0;
    }

Usage Example

Example #1
0
 public function testIsUnusedFalse()
 {
     $variable = new Variable('a', null, CompiledExpression::UNKNOWN);
     static::assertFalse($variable->isUnused());
 }