phplinter\Linter::determine_type PHP Метод

determine_type() защищенный Метод

----------------------------------------------------------------------+
protected determine_type ( $pos, Node $node, Node &$next_node ) : Array
$node phplinter\Lint\Node
$next_node phplinter\Lint\Node
Результат Array ----------------------------------------------------------------------+
    protected function determine_type($pos, Lint\Node $node, Lint\Node &$next_node)
    {
        $tokens = $this->tokens;
        $next = $this->find($pos, array(T_STRING, T_PARENTHESIS_OPEN));
        $type = $tokens[$pos][0];
        if ($next === false || $tokens[$next][0] === T_PARENTHESIS_OPEN) {
            // anonymous functions
            $name = 'anonymous';
            $type = T_ANON_FUNCTION;
        } else {
            $name = $tokens[$next][1];
            if (in_array($node->type, array(T_CLASS, T_INTERFACE)) && $tokens[$pos][0] == T_FUNCTION) {
                $type = T_METHOD;
                if ($node->type === T_INTERFACE) {
                    $next_node->abstract = true;
                }
            }
        }
        if ($type === T_METHOD || $type === T_ANON_FUNCTION) {
            $owner = $node->name;
        } else {
            $owner = $node->owner;
        }
        return array($type, $name, $owner);
    }