Exakat\Analyzer\Common\Extension::analyze PHP Метод

analyze() публичный Метод

public analyze ( )
    public function analyze()
    {
        if (substr($this->source, -4) == '.ini') {
            $ini = $this->loadIni($this->source);
        } else {
            return true;
        }
        if (!empty($ini['functions'])) {
            $functions = $this->makeFullNsPath($ini['functions']);
            $this->atomFunctionIs($functions);
            $this->prepareQuery();
        }
        if (!empty($ini['constants'])) {
            $this->atomIs('Identifier')->analyzerIs('Constants/ConstantUsage')->fullnspathIs($this->makeFullNsPath($ini['constants']));
            $this->prepareQuery();
        }
        if (!empty($ini['classes'])) {
            $classes = $this->makeFullNsPath($ini['classes']);
            $this->atomIs('New')->outIs('NEW')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->atomIsNot(array('Variable', 'Array', 'Property', 'Staticproperty', 'Methodcall', 'Staticmethodcall'))->fullnspathIs($classes);
            $this->prepareQuery();
            $this->atomIs('Staticconstant')->outIs('CLASS')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->fullnspathIs($classes);
            $this->prepareQuery();
            $this->atomIs('Staticmethodcall')->outIs('CLASS')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->fullnspathIs($classes);
            $this->prepareQuery();
            $this->atomIs('Staticproperty')->outIs('CLASS')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->fullnspathIs($classes);
            $this->prepareQuery();
            $this->atomIs('Function')->outIs('ARGUMENTS')->outIs('ARGUMENT')->outIs('TYPEHINT')->fullnspathIs($classes);
            $this->prepareQuery();
            $this->atomIs('Catch')->outIs('CLASS')->fullnspathIs($classes);
            $this->prepareQuery();
            $this->atomIs('Instanceof')->outIs('CLASS')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->atomIsNot(array('Array', 'Boolean', 'Null'))->fullnspathIs($classes);
            $this->prepareQuery();
        }
        if (!empty($ini['interfaces'])) {
            $interfaces = $this->makeFullNsPath($ini['interfaces']);
            $this->analyzerIs('Interfaces/InterfaceUsage')->fullnspathIs($interfaces);
            $this->prepareQuery();
        }
        if (!empty($ini['traits'])) {
            $this->analyzerIs('Traits/TraitUsage')->codeIs($ini['traits']);
            $this->prepareQuery();
            $traits = $this->makeFullNsPath($ini['traits']);
            $this->analyzerIs('Traits/TraitUsage')->fullnspathIs($traits);
            $this->prepareQuery();
        }
        if (!empty($ini['namespaces'])) {
            $namespaces = $this->makeFullNsPath($ini['namespaces']);
            $this->analyzerIs('Namespaces/NamespaceUsage')->outIs('NAME')->fullnspathIs($namespaces)->back('first');
            $this->prepareQuery();
            // Can a namespace be used in a nsname (as prefix) ?
        }
        if (!empty($ini['directives'])) {
            $this->analyzerIs('Php/DirectivesUsage')->outIs('ARGUMENTS')->outWithRank("ARGUMENT", 0)->noDelimiterIs($ini['directives']);
            $this->prepareQuery();
            // Can a namespace be used in a nsname (as prefix) ?
        }
    }

Usage Example

Пример #1
0
 public function analyze()
 {
     $this->source = 'xdebug.ini';
     parent::analyze();
 }
All Usage Examples Of Exakat\Analyzer\Common\Extension::analyze