diff --git a/src/CoordinateReferenceSystem/Geographic2D.php b/src/CoordinateReferenceSystem/Geographic2D.php index 0af926d9d..c6e40705f 100644 --- a/src/CoordinateReferenceSystem/Geographic2D.php +++ b/src/CoordinateReferenceSystem/Geographic2D.php @@ -4359,7 +4359,7 @@ class Geographic2D extends Geographic private static array $cachedObjects = [ ]; - public function __construct(string $srid, CoordinateSystem $coordinateSystem, Datum $datum, BoundingArea $boundingArea, string $name = '', self|Geographic3D $baseCRS = null) + public function __construct(string $srid, CoordinateSystem $coordinateSystem, Datum $datum, BoundingArea $boundingArea, string $name = '', self|Geographic3D|null $baseCRS = null) { $this->srid = $srid; $this->coordinateSystem = $coordinateSystem; @@ -4411,7 +4411,7 @@ public static function getSupportedSRIDsWithHelp(): array ], static::$sridData); } - public static function registerCustomCRS(string $srid, string $name, string $coordinateSystemSrid, string $datumSrid, BoundingArea $extent, string $baseCRSSrid = null, string $help = ''): void + public static function registerCustomCRS(string $srid, string $name, string $coordinateSystemSrid, string $datumSrid, BoundingArea $extent, ?string $baseCRSSrid = null, string $help = ''): void { self::$sridData[$srid] = [ 'name' => $name, diff --git a/src/CoordinateReferenceSystem/Geographic3D.php b/src/CoordinateReferenceSystem/Geographic3D.php index 3b068453a..66733fdba 100644 --- a/src/CoordinateReferenceSystem/Geographic3D.php +++ b/src/CoordinateReferenceSystem/Geographic3D.php @@ -1702,7 +1702,7 @@ class Geographic3D extends Geographic private static array $cachedObjects = [ ]; - public function __construct(string $srid, CoordinateSystem $coordinateSystem, Datum $datum, BoundingArea $boundingArea, string $name = '', Geocentric|self $baseCRS = null) + public function __construct(string $srid, CoordinateSystem $coordinateSystem, Datum $datum, BoundingArea $boundingArea, string $name = '', Geocentric|self|null $baseCRS = null) { $this->srid = $srid; $this->coordinateSystem = $coordinateSystem; @@ -1754,7 +1754,7 @@ public static function getSupportedSRIDsWithHelp(): array ], static::$sridData); } - public static function registerCustomCRS(string $srid, string $name, string $coordinateSystemSrid, string $datumSrid, BoundingArea $extent, string $baseCRSSrid = null, string $help = ''): void + public static function registerCustomCRS(string $srid, string $name, string $coordinateSystemSrid, string $datumSrid, BoundingArea $extent, ?string $baseCRSSrid = null, string $help = ''): void { self::$sridData[$srid] = [ 'name' => $name, diff --git a/src/CoordinateReferenceSystem/Projected.php b/src/CoordinateReferenceSystem/Projected.php index d29eb59d9..7d8ce9571 100644 --- a/src/CoordinateReferenceSystem/Projected.php +++ b/src/CoordinateReferenceSystem/Projected.php @@ -40688,7 +40688,7 @@ class Projected extends CoordinateReferenceSystem private static array $cachedObjects = [ ]; - public function __construct(string $srid, CoordinateSystem $coordinateSystem, Datum $datum, BoundingArea $boundingArea, string $name = '', Geographic2D|Geographic3D $baseCRS = null, string $derivingConversion = null) + public function __construct(string $srid, CoordinateSystem $coordinateSystem, Datum $datum, BoundingArea $boundingArea, string $name = '', Geographic2D|Geographic3D|null $baseCRS = null, ?string $derivingConversion = null) { $this->srid = $srid; $this->coordinateSystem = $coordinateSystem; diff --git a/src/Point/BritishNationalGridPoint.php b/src/Point/BritishNationalGridPoint.php index acec582aa..63d6f79f6 100644 --- a/src/Point/BritishNationalGridPoint.php +++ b/src/Point/BritishNationalGridPoint.php @@ -29,7 +29,7 @@ class BritishNationalGridPoint extends ProjectedPoint { private const GRID_LETTERS = 'VWXYZQRSTULMNOPFGHJKABCDE'; - public function __construct(Length $easting, Length $northing, DateTimeInterface $epoch = null) + public function __construct(Length $easting, Length $northing, ?DateTimeInterface $epoch = null) { parent::__construct(Projected::fromSRID(Projected::EPSG_OSGB36_BRITISH_NATIONAL_GRID), $easting, $northing, null, null, $epoch, null); } @@ -37,7 +37,7 @@ public function __construct(Length $easting, Length $northing, DateTimeInterface /** * @param string $reference OS grid reference (e.g. "TG514131") */ - public static function fromGridReference(string $reference, DateTimeInterface $epoch = null): self + public static function fromGridReference(string $reference, ?DateTimeInterface $epoch = null): self { $reference = str_replace(' ', '', $reference); diff --git a/src/Point/CompoundPoint.php b/src/Point/CompoundPoint.php index 4fc8dc688..f1dcafc08 100644 --- a/src/Point/CompoundPoint.php +++ b/src/Point/CompoundPoint.php @@ -64,7 +64,7 @@ class CompoundPoint extends Point implements ConvertiblePoint */ protected ?DateTimeImmutable $epoch; - protected function __construct(Compound $crs, GeographicPoint|ProjectedPoint $horizontalPoint, VerticalPoint $verticalPoint, DateTimeInterface $epoch = null) + protected function __construct(Compound $crs, GeographicPoint|ProjectedPoint $horizontalPoint, VerticalPoint $verticalPoint, ?DateTimeInterface $epoch = null) { $this->horizontalPoint = $horizontalPoint; $this->verticalPoint = $verticalPoint; @@ -76,7 +76,7 @@ protected function __construct(Compound $crs, GeographicPoint|ProjectedPoint $ho $this->epoch = $epoch; } - public static function create(Compound $crs, GeographicPoint|ProjectedPoint $horizontalPoint, VerticalPoint $verticalPoint, DateTimeInterface $epoch = null): self + public static function create(Compound $crs, GeographicPoint|ProjectedPoint $horizontalPoint, VerticalPoint $verticalPoint, ?DateTimeInterface $epoch = null): self { return new self($crs, $horizontalPoint, $verticalPoint, $epoch); } diff --git a/src/Point/GeocentricPoint.php b/src/Point/GeocentricPoint.php index 95da09f86..f9c3cba73 100644 --- a/src/Point/GeocentricPoint.php +++ b/src/Point/GeocentricPoint.php @@ -67,7 +67,7 @@ class GeocentricPoint extends Point implements ConvertiblePoint */ protected ?DateTimeImmutable $epoch; - protected function __construct(Geocentric $crs, Length $x, Length $y, Length $z, DateTimeInterface $epoch = null) + protected function __construct(Geocentric $crs, Length $x, Length $y, Length $z, ?DateTimeInterface $epoch = null) { $this->crs = $crs; $this->x = $x::convert($x, $this->crs->getCoordinateSystem()->getAxisByName(Axis::GEOCENTRIC_X)->getUnitOfMeasureId()); @@ -85,7 +85,7 @@ protected function __construct(Geocentric $crs, Length $x, Length $y, Length $z, * @param Length $y refer to CRS for preferred unit of measure, but any length unit accepted * @param Length $z refer to CRS for preferred unit of measure, but any length unit accepted */ - public static function create(Geocentric $crs, Length $x, Length $y, Length $z, DateTimeInterface $epoch = null): self + public static function create(Geocentric $crs, Length $x, Length $y, Length $z, ?DateTimeInterface $epoch = null): self { return new self($crs, $x, $y, $z, $epoch); } diff --git a/src/Point/GeographicPoint.php b/src/Point/GeographicPoint.php index 8559427f6..55c540cda 100644 --- a/src/Point/GeographicPoint.php +++ b/src/Point/GeographicPoint.php @@ -134,7 +134,7 @@ protected function __construct(Geographic2D|Geographic3D $crs, Angle $latitude, * @param Angle $latitude refer to CRS for preferred unit of measure, but any angle unit accepted * @param Angle $longitude refer to CRS for preferred unit of measure, but any angle unit accepted */ - public static function create(Geographic2D|Geographic3D $crs, Angle $latitude, Angle $longitude, Length $height = null, DateTimeInterface $epoch = null): self + public static function create(Geographic2D|Geographic3D $crs, Angle $latitude, Angle $longitude, ?Length $height = null, ?DateTimeInterface $epoch = null): self { return new self($crs, $latitude, $longitude, $height, $epoch); } diff --git a/src/Point/IrishGridPoint.php b/src/Point/IrishGridPoint.php index 027b51369..cd74b46b8 100644 --- a/src/Point/IrishGridPoint.php +++ b/src/Point/IrishGridPoint.php @@ -32,7 +32,7 @@ class IrishGridPoint extends ProjectedPoint { private const GRID_LETTERS = 'VWXYZQRSTULMNOPFGHJKABCDE'; - public function __construct(Length $easting, Length $northing, DateTimeInterface $epoch = null) + public function __construct(Length $easting, Length $northing, ?DateTimeInterface $epoch = null) { parent::__construct(Projected::fromSRID(Projected::EPSG_TM75_IRISH_GRID), $easting, $northing, null, null, $epoch, null); } @@ -40,7 +40,7 @@ public function __construct(Length $easting, Length $northing, DateTimeInterface /** * @param string $reference Irish grid reference (e.g. "T514131") */ - public static function fromGridReference(string $reference, DateTimeInterface $epoch = null): self + public static function fromGridReference(string $reference, ?DateTimeInterface $epoch = null): self { $reference = str_replace(' ', '', $reference); diff --git a/src/Point/IrishTransverseMercatorPoint.php b/src/Point/IrishTransverseMercatorPoint.php index 7fc24ed7d..03a6ec7b0 100644 --- a/src/Point/IrishTransverseMercatorPoint.php +++ b/src/Point/IrishTransverseMercatorPoint.php @@ -17,7 +17,7 @@ */ class IrishTransverseMercatorPoint extends ProjectedPoint { - public function __construct(Length $easting, Length $northing, DateTimeInterface $epoch = null) + public function __construct(Length $easting, Length $northing, ?DateTimeInterface $epoch = null) { parent::__construct(Projected::fromSRID(Projected::EPSG_IRENET95_IRISH_TRANSVERSE_MERCATOR), $easting, $northing, null, null, $epoch, null); } diff --git a/src/Point/ProjectedPoint.php b/src/Point/ProjectedPoint.php index c5458fea5..964b1bf54 100644 --- a/src/Point/ProjectedPoint.php +++ b/src/Point/ProjectedPoint.php @@ -150,7 +150,7 @@ protected function __construct(Projected $crs, ?Length $easting, ?Length $northi $this->height = $height; } - public static function create(Projected $crs, ?Length $easting, ?Length $northing, ?Length $westing, ?Length $southing, DateTimeInterface $epoch = null, Length $height = null): self + public static function create(Projected $crs, ?Length $easting, ?Length $northing, ?Length $westing, ?Length $southing, ?DateTimeInterface $epoch = null, ?Length $height = null): self { return match ($crs->getSRID()) { Projected::EPSG_OSGB36_BRITISH_NATIONAL_GRID => new BritishNationalGridPoint($easting, $northing, $epoch), @@ -160,17 +160,17 @@ public static function create(Projected $crs, ?Length $easting, ?Length $northin }; } - public static function createFromEastingNorthing(Projected $crs, Length $easting, Length $northing, DateTimeInterface $epoch = null, Length $height = null): self + public static function createFromEastingNorthing(Projected $crs, Length $easting, Length $northing, ?DateTimeInterface $epoch = null, ?Length $height = null): self { return static::create($crs, $easting, $northing, null, null, $epoch, $height); } - public static function createFromWestingNorthing(Projected $crs, Length $westing, Length $northing, DateTimeInterface $epoch = null, Length $height = null): self + public static function createFromWestingNorthing(Projected $crs, Length $westing, Length $northing, ?DateTimeInterface $epoch = null, ?Length $height = null): self { return static::create($crs, null, $northing, $westing, null, $epoch, $height); } - public static function createFromWestingSouthing(Projected $crs, Length $westing, Length $southing, DateTimeInterface $epoch = null, Length $height = null): self + public static function createFromWestingSouthing(Projected $crs, Length $westing, Length $southing, ?DateTimeInterface $epoch = null, ?Length $height = null): self { return static::create($crs, null, null, $westing, $southing, $epoch, $height); } @@ -2166,8 +2166,8 @@ public function complexPolynomial( Scale $A4, Scale $A5, Scale $A6, - Scale $A7 = null, - Scale $A8 = null + ?Scale $A7 = null, + ?Scale $A8 = null ): self { $xs = $this->easting->getValue(); $ys = $this->northing->getValue(); diff --git a/src/Point/UTMPoint.php b/src/Point/UTMPoint.php index 810dd333b..1d6585bf5 100644 --- a/src/Point/UTMPoint.php +++ b/src/Point/UTMPoint.php @@ -47,7 +47,7 @@ class UTMPoint extends ProjectedPoint */ protected Geographic2D|Geographic3D $baseCRS; - public function __construct(Geographic2D|Geographic3D $crs, Length $easting, Length $northing, int $zone, string $hemisphere, DateTimeInterface $epoch = null) + public function __construct(Geographic2D|Geographic3D $crs, Length $easting, Length $northing, int $zone, string $hemisphere, ?DateTimeInterface $epoch = null) { $this->zone = $zone; $this->hemisphere = $hemisphere; diff --git a/src/Point/VerticalPoint.php b/src/Point/VerticalPoint.php index 50c286da4..918d24078 100644 --- a/src/Point/VerticalPoint.php +++ b/src/Point/VerticalPoint.php @@ -47,7 +47,7 @@ class VerticalPoint extends Point * Constructor. * @param Length $height refer to CRS for preferred unit of measure, but any length unit accepted */ - protected function __construct(Vertical $crs, Length $height, DateTimeInterface $epoch = null) + protected function __construct(Vertical $crs, Length $height, ?DateTimeInterface $epoch = null) { $this->height = $height::convert($height, $crs->getCoordinateSystem()->getAxes()[0]->getUnitOfMeasureId()); $this->crs = $crs; @@ -62,7 +62,7 @@ protected function __construct(Vertical $crs, Length $height, DateTimeInterface * Constructor. * @param Length $height refer to CRS for preferred unit of measure, but any length unit accepted */ - public static function create(Vertical $crs, Length $height, DateTimeInterface $epoch = null): self + public static function create(Vertical $crs, Length $height, ?DateTimeInterface $epoch = null): self { return new self($crs, $height, $epoch); }