Exakat\Tasks\Load::processOneNsname PHP Метод

processOneNsname() приватный Метод

private processOneNsname ( )
    private function processOneNsname()
    {
        $rank = -1;
        $fullcode = array();
        if ($this->tokens[$this->id + 1][0] !== T_NS_SEPARATOR) {
            $subnameId = $this->processNextAsIdentifier();
            $this->pushExpression($subnameId);
            $hasPrevious = true;
        } else {
            $hasPrevious = false;
        }
        $current = $this->id;
        if ($this->tokens[$this->id + 1][0] === T_NS_SEPARATOR) {
            $extendsId = $this->addAtom('Nsname');
            // Previous one
            if ($hasPrevious === true) {
                $subnameId = $this->popExpression();
                $this->setAtom($subnameId, array('rank' => ++$rank));
                $fullcode[] = $this->atoms[$subnameId]['code'];
                $this->addLink($extendsId, $subnameId, 'SUBNAME');
            } else {
                $fullcode[] = '';
            }
            // Next one (at least one)
            while ($this->tokens[$this->id + 1][0] === T_NS_SEPARATOR && $this->tokens[$this->id + 2][0] !== T_OPEN_CURLY) {
                ++$this->id;
                // Skip \
                $subnameId = $this->processNextAsIdentifier();
                $this->setAtom($subnameId, array('rank' => ++$rank));
                $fullcode[] = $this->atoms[$subnameId]['code'];
                $this->addLink($extendsId, $subnameId, 'SUBNAME');
            }
            $this->setAtom($extendsId, array('code' => '\\', 'fullcode' => implode('\\', $fullcode), 'line' => $this->tokens[$current][2], 'token' => $this->getToken($this->tokens[$current + 1][0]), 'variadic' => false, 'absolute' => !$hasPrevious));
            $fullnspath = $this->getFullnspath($extendsId);
            $this->setAtom($extendsId, array('fullnspath' => $fullnspath));
        } else {
            $extendsId = $this->popExpression();
        }
        return $extendsId;
    }
Load