Skip to content

Commit

Permalink
Update PHP-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Feb 3, 2024
1 parent 478a8dc commit 403ece2
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/CoordinateReferenceSystem/Geographic2D.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/CoordinateReferenceSystem/Geographic3D.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/CoordinateReferenceSystem/Projected.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Point/BritishNationalGridPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ 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);
}

/**
* @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);

Expand Down
4 changes: 2 additions & 2 deletions src/Point/CompoundPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Point/GeocentricPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Point/GeographicPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Point/IrishGridPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ 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);
}

/**
* @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);

Expand Down
2 changes: 1 addition & 1 deletion src/Point/IrishTransverseMercatorPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions src/Point/ProjectedPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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);
}
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/Point/UTMPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Point/VerticalPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit 403ece2

Please sign in to comment.