Exakat\Data\Methods::getFunctionsReferenceArgs PHP Méthode

getFunctionsReferenceArgs() public méthode

    public function getFunctionsReferenceArgs()
    {
        $query = "SELECT name AS function, 0 AS position FROM args_is_ref WHERE Class = 'PHP' AND arg0 = 'reference' UNION\n                  SELECT name AS function, 1 AS position FROM args_is_ref WHERE Class = 'PHP' AND arg1 = 'reference' UNION\n                  SELECT name AS function, 2 AS position FROM args_is_ref WHERE Class = 'PHP' AND arg2 = 'reference' UNION\n                  SELECT name AS function, 3 AS position FROM args_is_ref WHERE Class = 'PHP' AND arg3 = 'reference' UNION\n                  SELECT name AS function, 4 AS position FROM args_is_ref WHERE Class = 'PHP' AND arg4 = 'reference' UNION\n                  SELECT name AS function, 5 AS position FROM args_is_ref WHERE Class = 'PHP' AND arg5 = 'reference'\n                  ";
        $res = $this->sqlite->query($query);
        $return = array();
        while ($row = $res->fetchArray(\SQLITE3_ASSOC)) {
            $return[] = $row;
        }
        return $return;
    }

Usage Example

Exemple #1
0
 public function analyze()
 {
     $atoms = array('Property', 'Staticproperty');
     $this->atomIs($atoms)->hasIn(array('PREPLUSPLUS', 'POSTPLUSPLUS', 'DEFINE', 'CAST'))->back('first');
     $this->prepareQuery();
     $this->atomIs($atoms)->inIs(array('LEFT', 'APPEND'))->atomIs(array('Assignation', 'Arrayappend'))->back('first');
     $this->prepareQuery();
     // arguments : reference variable in a custom function
     $this->atomIs($atoms)->savePropertyAs('rank', 'rank')->inIs('ARGUMENT')->inIs('ARGUMENTS')->hasNoIn('METHOD')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->functionDefinition()->outIs('ARGUMENTS')->outIs('ARGUMENT')->samePropertyAs('rank', 'rank', true)->is('reference', true)->back('first');
     $this->prepareQuery();
     // PHP functions that are references
     $data = new Methods();
     $functions = $data->getFunctionsReferenceArgs();
     $references = array();
     foreach ($functions as $function) {
         if (!isset($references[$function['position']])) {
             $references[$function['position']] = array('\\' . $function['function']);
         } else {
             $references[$function['position']][] = '\\' . $function['function'];
         }
     }
     foreach ($references as $position => $functions) {
         $this->atomIs($atoms)->inIsIE('VARIABLE')->is('rank', $position)->inIs('ARGUMENT')->inIs('ARGUMENTS')->hasNoIn('METHOD')->atomIs('Functioncall')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR', 'T_UNSET'))->fullnspathIs($functions)->back('first');
         $this->prepareQuery();
     }
     // Class constructors (__construct)
     $this->atomIs($atoms)->savePropertyAs('rank', 'rank')->inIs('ARGUMENT')->inIs('ARGUMENTS')->hasNoIn('METHOD')->tokenIs(array('T_STRING', 'T_NS_SEPARATOR'))->atomIs('Functioncall')->hasIn('NEW')->classDefinition()->outIs('BLOCK')->outIs('ELEMENT')->analyzerIs('Classes/Constructor')->outIs('ARGUMENTS')->outIs('ARGUMENT')->samePropertyAs('rank', 'rank')->is('reference', true)->back('first');
     $this->prepareQuery();
 }
All Usage Examples Of Exakat\Data\Methods::getFunctionsReferenceArgs