protected function parseBlockLine($line, \SplFileObject $file, $lineBreaks)
    {
        $block = new Block();

        $args = $this->blockRegex($line);
        $name = array_shift($args);

        if ($name === null) {
            $lineNum = $file->key();
            throw new SyntaxException($lineNum, $line, "Could not parse the name of the block");
        }

        $block->setName($name)
              ->setArguments($args)
              ->setLineBreaks($lineBreaks);

        // Now we parse the children
        $newLine = $file->getCurrentLine();

        while (!$this->isBlockEnd($newLine, $name)) {
            $parsedLine = $this->parseLine($newLine, $file);
            if (!is_null($parsedLine)) {
                $block->addChild($parsedLine);
            }
            $newLine = $file->getCurrentLine();
        }

        return $block;
    }
protected function parseBlockLine($line, \SplFileObject $file, $lineBreaks)
    {
        $block = new Block();

        $args = $this->blockRegex($line);
        $name = array_shift($args);

        if ($name === null) {
            $lineNum = $file->key();
            throw new SyntaxException($lineNum, $line, "Could not parse the name of the block");
        }

        $block->setName($name)
              ->setArguments($args)
              ->setLineBreaks($lineBreaks);

        // Now we parse the children
        $newLine = $file->getCurrentLine();

        while (!$this->isBlockEnd($newLine, $name)) {
            $parsedLine = $this->parseLine($newLine, $file);
            if (!is_null($parsedLine)) {
                $block->addChild($parsedLine);
            }
            $newLine = $file->getCurrentLine();
        }

        return $block;
    }
protected function parseBlockLine ( $ line , \ SplFileObject $ file , $ lineBreaks ) { $ block = new Block ( ) ; $ args = $ this -> blockRegex ( $ line ) ; $ name = array_shift ( $ args ) ; if ( $ name === null ) { $ lineNum = $ file -> key ( ) ; throw new SyntaxException ( $ lineNum , $ line , "Could not parse the name of the block" ) ; } $ block -> setName ( $ name ) -> setArguments ( $ args ) -> setLineBreaks ( $ lineBreaks ) ; // Now we parse the children $ newLine = $ file -> getCurrentLine ( ) ; while ( ! $ this -> isBlockEnd ( $ newLine , $ name ) ) { $ parsedLine = $ this -> parseLine ( $ newLine , $ file ) ; if ( ! is_null ( $ parsedLine ) ) { $ block -> addChild ( $ parsedLine ) ; } $ newLine = $ file -> getCurrentLine ( ) ; } return $ block ; }
Parse a Block Line

@param string $line
@param \SplFileObject $file
@return Block
@throws SyntaxException
Parse a Block Line