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

brick / geo / 13766209603

09 Mar 2025 10:35PM UTC coverage: 87.414% (+3.3%) from 84.117%
13766209603

push

github

BenMorel
Add Point::isEqualTo() (WIP: finish? keep?)

8 of 8 new or added lines in 2 files covered. (100.0%)

73 existing lines in 16 files now uncovered.

1653 of 1891 relevant lines covered (87.41%)

1946.79 hits per line

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

72.73
/src/IO/WKBTools.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Geo\IO;
6

7
use Brick\Geo\Exception\GeometryIOException;
8

9
/**
10
 * Tools for WKB classes.
11
 *
12
 * @internal
13
 */
14
abstract class WKBTools
15
{
16
    /**
17
     * @throws GeometryIOException
18
     */
19
    private static function checkDoubleIs64Bit() : void
20
    {
21
        if (strlen(pack('d', 0.0)) !== 8) {
6✔
UNCOV
22
            throw new GeometryIOException('The double type is not 64 bit on this platform.');
×
23
        }
24
    }
25

26
    /**
27
     * Detects the machine byte order (big endian or little endian).
28
     *
29
     * @throws GeometryIOException
30
     */
31
    public static function getMachineByteOrder() : WKBByteOrder
32
    {
33
        /** @var WKBByteOrder|null $byteOrder */
34
        static $byteOrder;
13,203✔
35

36
        if ($byteOrder === null) {
13,203✔
37
            self::checkDoubleIs64Bit();
6✔
38

39
            $byteOrder = match (pack('L', 0x61626364)) {
6✔
40
                'abcd' => WKBByteOrder::BIG_ENDIAN,
×
41
                'dcba' => WKBByteOrder::LITTLE_ENDIAN,
6✔
UNCOV
42
                default => throw GeometryIOException::unsupportedEndianness(),
×
43
            };
6✔
44
        }
45

46
        return $byteOrder;
13,203✔
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

© 2026 Coveralls, Inc