Exakat\Analyzer\Common\TraitUsage::analyze PHP Method

analyze() public method

public analyze ( )
    public function analyze()
    {
        $traits = $this->makeFullNsPath($this->traits);
        $this->atomIs('Staticmethodcall')->outIs('CLASS')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->atomIsNot('Array')->fullnspathIs($traits);
        $this->prepareQuery();
        $this->atomIs('Staticproperty')->outIs('CLASS')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->atomIsNot('Array')->fullnspathIs($traits);
        $this->prepareQuery();
        $this->atomIs('Instanceof')->outIs('CLASS')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->atomIsNot('Array')->fullnspathIs($traits);
        $this->prepareQuery();
        // Check that... Const/function and aliases
        $this->atomIs('Use')->hasClassTrait()->outIs('USE')->outIsIE('NAME')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->fullnspathIs($traits);
        $this->prepareQuery();
    }

Usage Example

 public function analyze()
 {
     $this->traits = '\\cake\\routing\\requestactiontrait';
     return parent::analyze();
 }
TraitUsage