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

brick / geo / 13716844819

07 Mar 2025 08:35AM UTC coverage: 47.964% (+3.9%) from 44.086%
13716844819

push

github

BenMorel
Add TypeChecker for engines

8 of 21 new or added lines in 5 files covered. (38.1%)

98 existing lines in 18 files now uncovered.

1684 of 3511 relevant lines covered (47.96%)

944.32 hits per line

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

50.0
/src/Engine/Internal/TypeChecker.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Geo\Engine\Internal;
6

7
use Brick\Geo\Exception\GeometryEngineException;
8
use Brick\Geo\Geometry;
9

10
/**
11
 * Type checker for engine return values.
12
 */
13
final class TypeChecker
14
{
15
    /**
16
     * Checks that the given geometry is an instance of the expected class.
17
     *
18
     * @template T of Geometry
19
     * @psalm-assert T $geometry
20
     *
21
     * @param class-string<T> $className
22
     *
23
     * @throws GeometryEngineException
24
     */
25
    public static function check(Geometry $geometry, string $className) : void
26
    {
27
        if (! $geometry instanceof $className) {
104✔
NEW
28
            throw GeometryEngineException::unexpectedReturnType($className, get_class($geometry));
×
29
        }
30
    }
31
}
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