• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

filhocodes / twig-stack-extension / 3931621931

pending completion
3931621931

Pull #5

github

GitHub
Merge 139b3f647 into b1bf7c8a8
Pull Request #5: Add PHP 8.2 to the tests

160 of 171 relevant lines covered (93.57%)

3.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/TokenParsers/StackTokenParser.php
1
<?php
2
declare(strict_types=1);
3

4
namespace FilhoCodes\TwigStackExtension\TokenParsers;
5

6
use FilhoCodes\TwigStackExtension\Nodes\StackNode;
7
use Twig\Token;
8
use Twig\TokenParser\AbstractTokenParser;
9

10
/**
11
 * StackTokenParser
12
 *
13
 * Declares the tag `{% stack %}`.
14
 */
15
final class StackTokenParser extends AbstractTokenParser
16
{
17
    /**
18
     * @inheritDoc
19
     */
20
    public function parse(Token $token)
21
    {
22
        $stream = $this->parser->getStream();
4✔
23

24
        $name = $stream->expect(Token::NAME_TYPE)->getValue();
4✔
25
        $stream->expect(Token::BLOCK_END_TYPE);
4✔
26

27
        return new StackNode($name, $token->getLine());
4✔
28
    }
29

30
    /**
31
     * @inheritDoc
32
     */
33
    public function getTag()
34
    {
35
        return 'stack';
4✔
36
    }
37
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc