SebastianBergmann\CodeCoverage\Node\File::processTraits PHP Method

processTraits() protected method

protected processTraits ( PHP_Token_Stream $tokens )
$tokens PHP_Token_Stream
    protected function processTraits(\PHP_Token_Stream $tokens)
    {
        $traits = $tokens->getTraits();
        unset($tokens);
        $link = $this->getId() . '.html#';
        foreach ($traits as $traitName => $trait) {
            $this->traits[$traitName] = ['traitName' => $traitName, 'methods' => [], 'startLine' => $trait['startLine'], 'executableLines' => 0, 'executedLines' => 0, 'ccn' => 0, 'coverage' => 0, 'crap' => 0, 'package' => $trait['package'], 'link' => $link . $trait['startLine']];
            $this->startLines[$trait['startLine']] =& $this->traits[$traitName];
            $this->endLines[$trait['endLine']] =& $this->traits[$traitName];
            foreach ($trait['methods'] as $methodName => $method) {
                $this->traits[$traitName]['methods'][$methodName] = $this->newMethod($methodName, $method, $link);
                $this->startLines[$method['startLine']] =& $this->traits[$traitName]['methods'][$methodName];
                $this->endLines[$method['endLine']] =& $this->traits[$traitName]['methods'][$methodName];
            }
        }
    }