forked from MatanYadaev/laravel-eloquent-spatial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPointCollection.php
33 lines (28 loc) · 870 Bytes
/
PointCollection.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
declare(strict_types=1);
namespace MatanYadaev\EloquentSpatial\Objects;
use Illuminate\Support\Collection;
use InvalidArgumentException;
use MatanYadaev\EloquentSpatial\Enums\Srid;
/**
* @property Collection<int, Point> $geometries
*
* @method Collection<int, Point> getGeometries()
* @method Point offsetGet(int $offset)
* @method void offsetSet(int $offset, Point $value)
*/
abstract class PointCollection extends GeometryCollection
{
protected string $collectionOf = Point::class;
/**
* @param Collection<int, Point>|array<int, Point> $geometries
* @param int $srid
*
* @throws InvalidArgumentException
*/
public function __construct(Collection|array $geometries, int|Srid $srid = 0)
{
// @phpstan-ignore-next-line
parent::__construct($geometries, $this->srid = $srid instanceof Srid ? $srid->value : $srid);
}
}