Exakat\Analyzer\Classes\AvoidUsing::analyze PHP Method

analyze() public method

public analyze ( )
    public function analyze()
    {
        $classes = $this->config->Classes_AvoidUsing;
        if (empty($classes)) {
            return null;
        }
        $classesPath = $this->makeFullNsPath($classes);
        // class may be used in a class
        $this->atomIs('Class')->fullnspathIs($classesPath)->back('first');
        $this->prepareQuery();
        // class may be used in a new
        $this->atomIs('New')->outIs('NEW')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->fullnspathIs($classesPath)->back('first');
        $this->prepareQuery();
        // class may be used in a Staticmethodcall
        $this->atomIs(array('Staticmethodcall', 'Staticproperty', 'Staticconstant', 'Instanceof'))->outIs('CLASS')->fullnspathIs($classesPath)->back('first');
        $this->prepareQuery();
        // class may be used in a typehint
        $this->atomIs('Function')->outIs('ARGUMENTS')->outIs('ARGUMENT')->outIs('TYPEHINT')->fullnspathIs($classesPath)->back('first');
        $this->prepareQuery();
        // class may be used in an extension
        $this->atomIs('Class')->outIs(array('EXTENDS', 'IMPLEMENTS'))->fullnspathIs($classesPath)->back('first');
        $this->prepareQuery();
        // class may be used in an use
        $this->atomIs('Use')->outIs('USE')->fullnspathIs($classesPath)->back('first');
        $this->prepareQuery();
        $this->atomFunctionIs('\\class_alias')->outIs('ARGUMENTS')->outIs('ARGUMENT')->is('rank', 0)->atomIs('String')->noDelimiterIs(array_merge($classes, $classesPath));
        $this->prepareQuery();
        // mentions in strings
        $this->atomIs('String')->regexIs('noDelimiter', join('|', $classes));
        $this->prepareQuery();
    }
AvoidUsing