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

brick / geo / 17456208570

04 Sep 2025 07:10AM UTC coverage: 50.432%. Remained the same
17456208570

push

github

BenMorel
Use @extends and @implements instead of @template-* variants

For consistency with the rest of the project.

1867 of 3702 relevant lines covered (50.43%)

1140.21 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
use function get_class;
11

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