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

jojo1981 / php-types / 12707605573

10 Jan 2025 10:18AM UTC coverage: 88.119%. Remained the same
12707605573

push

github

jojo1981
Use GitHub actions workflow for CI instead of Travis CI.

267 of 303 relevant lines covered (88.12%)

16.43 hits per line

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

0.0
/src/Parser/Listener/ThrowingErrorListener.php
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of the jojo1981/php-types package
4
 *
5
 * Copyright (c) 2021 Joost Nijhuis <jnijhuis81@gmail.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed in the root of the source code
9
 */
10
namespace Jojo1981\PhpTypes\Parser\Listener;
11

12
use Antlr\Antlr4\Runtime\Error\Exceptions\ParseCancellationException;
13
use Antlr\Antlr4\Runtime\Error\Exceptions\RecognitionException;
14
use Antlr\Antlr4\Runtime\Error\Listeners\BaseErrorListener;
15
use Antlr\Antlr4\Runtime\Recognizer;
16

17
/**
18
 * @internal
19
 * @package Jojo1981\PhpTypes\Parser\Listener
20
 */
21
class ThrowingErrorListener extends BaseErrorListener
22
{
23
    /**
24
     * @param Recognizer $recognizer
25
     * @param object|null $offendingSymbol
26
     * @param int $line
27
     * @param int $charPositionInLine
28
     * @param string $msg
29
     * @param RecognitionException|null $e
30
     * @return void
31
     * @throws ParseCancellationException
32
     */
33
    public function syntaxError(
34
        Recognizer $recognizer,
35
        ?object $offendingSymbol,
36
        int $line,
37
        int $charPositionInLine,
38
        string $msg,
39
        ?RecognitionException $e
40
    ): void {
41
        throw new ParseCancellationException('line ' . $line . ':' . $charPositionInLine . ' ' . $msg);
×
42
    }
43
}
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