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

longitude-one / wkt-parser / 10407526443

16 May 2024 07:54AM UTC coverage: 99.145% (-0.9%) from 100.0%
10407526443

push

github

web-flow
Merge pull request #22 from longitude-one/20-implement-triangle

Triangle implemented #20

25 of 25 new or added lines in 1 file covered. (100.0%)

2 existing lines in 2 files now uncovered.

232 of 234 relevant lines covered (99.15%)

70.09 hits per line

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

94.44
/lib/LongitudeOne/Geo/WKT/Exception/NotInstantiableException.php
1
<?php
2

3
/**
4
 * This file is part of the LongitudeOne WKT-Parser project.
5
 *
6
 * PHP 8.1 | 8.2 | 8.3
7
 *
8
 * Copyright LongitudeOne - Alexandre Tranchant - Derek J. Lambert.
9
 * Copyright 2024.
10
 *
11
 */
12

13
namespace LongitudeOne\Geo\WKT\Exception;
14

15
use LongitudeOne\Geo\WKT\Parser;
16

17
/**
18
 * Not yet implemented exception.
19
 *
20
 * @param ('GEOMETRY'|'CURVE'|'SOLID'|'SURFACE') $message the message to display
21
 */
22
final class NotInstantiableException extends \LogicException implements ExceptionInterface
23
{
24
    public function __construct(string $message, int $code = 0, ?\Throwable $previous = null)
8✔
25
    {
26
        $advise = match ($message) {
8✔
27
            Parser::GEOMETRY => Parser::GEOMETRY_COLLECTION,
2✔
28
            Parser::CURVE => Parser::MULTI_CURVE,
2✔
29
            Parser::SOLID => Parser::POLYGON,
2✔
30
            Parser::SURFACE => Parser::MULTI_SURFACE,
2✔
UNCOV
31
            default => null,
×
32
        };
8✔
33

34
        $finalMessage = sprintf(
8✔
35
            'According the ISO 13249-3:2016 standard, the "%s" type is not instantiable.',
8✔
36
            $message
8✔
37
        );
8✔
38

39
        if (null !== $advise) {
8✔
40
            $finalMessage .= sprintf(
8✔
41
                ' Did you mean "%s"?',
8✔
42
                $advise
8✔
43
            );
8✔
44
        }
45

46
        parent::__construct($finalMessage, $code, $previous);
8✔
47
    }
48
}
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

© 2025 Coveralls, Inc