Skip to content

Commit

Permalink
Merge pull request #40 from Chris53897/patch-1
Browse files Browse the repository at this point in the history
chore: Add tests for PHP 8.4
  • Loading branch information
bresam authored Oct 1, 2024
2 parents 728129b + 11382fc commit e97a9a0
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 29 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ jobs:
- php: '8.3'
symfony-version: 7.0.*
stability: prefer-stable

- php: '8.4'
symfony-version: 7.0.*
stability: prefer-stable

env:
APP_ENV: test
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Bound.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Bound implements VariableAwareInterface
#[SerializedName('extendables')]
private array $extendables = [];

public function __construct(Coordinate $southWest = null, Coordinate $northEast = null)
public function __construct(?Coordinate $southWest = null, ?Coordinate $northEast = null)
{
$this->setSouthWest($southWest);
$this->setNorthEast($northEast);
Expand Down
4 changes: 2 additions & 2 deletions src/Helper/Builder/JsonBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class JsonBuilder
private $jsonEncodeOptions;


public function __construct(PropertyAccessorInterface $propertyAccessor = null)
public function __construct(?PropertyAccessorInterface $propertyAccessor = null)
{
$this->accessor = $propertyAccessor ?: new PropertyAccessor();

Expand Down Expand Up @@ -71,7 +71,7 @@ public function getValues(): array
return $this->values;
}

public function setValues(array $values, string $pathPrefix = null): JsonBuilder
public function setValues(array $values, ?string $pathPrefix = null): JsonBuilder
{
foreach ($values as $key => $value) {
$path = sprintf('%s[%s]', $pathPrefix, $key);
Expand Down
4 changes: 2 additions & 2 deletions src/Helper/Formatter/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public function renderContainerAssignment(
VariableAwareInterface $root,
$declaration,
$propertyPath = null,
VariableAwareInterface $object = null,
?VariableAwareInterface $object = null,
$semicolon = true,
$newLine = true
) {
Expand All @@ -257,7 +257,7 @@ public function renderContainerAssignment(
public function renderContainerVariable(
VariableAwareInterface $root,
$propertyPath = null,
VariableAwareInterface $object = null
?VariableAwareInterface $object = null
) {
$variable = $root->getVariable().'_container';

Expand Down
2 changes: 1 addition & 1 deletion src/Place/Autocomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function getBound()
return $this->bound;
}

public function setBound(Bound $bound = null)
public function setBound(?Bound $bound = null)
{
$this->bound = $bound;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/AbstractSerializableService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(
string $url,
HttpClient $client,
MessageFactory $messageFactory,
SerializerInterface $serializer = null
?SerializerInterface $serializer = null
) {
parent::__construct($url, $client, $messageFactory);

Expand Down
2 changes: 1 addition & 1 deletion src/Service/Base/Geometry.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getBound()
return $this->bound;
}

public function setBound(Bound $bound = null)
public function setBound(?Bound $bound = null)
{
$this->bound = $bound;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Direction/DirectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DirectionService extends AbstractSerializableService
public function __construct(
HttpClient $client,
MessageFactory $messageFactory,
SerializerInterface $serializer = null
?SerializerInterface $serializer = null
) {
parent::__construct('https://maps.googleapis.com/maps/api/directions', $client, $messageFactory, $serializer);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Direction/Response/DirectionRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getBound(): ?Bound
return $this->bound;
}

public function setBound(Bound $bound = null): void
public function setBound(?Bound $bound = null): void
{
$this->bound = $bound;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DistanceMatrix/DistanceMatrixService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DistanceMatrixService extends AbstractSerializableService
public function __construct(
HttpClient $client,
MessageFactory $messageFactory,
SerializerInterface $serializer = null
?SerializerInterface $serializer = null
) {
parent::__construct(
'https://maps.googleapis.com/maps/api/distancematrix',
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Elevation/ElevationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ElevationService extends AbstractSerializableService
public function __construct(
HttpClient $client,
MessageFactory $messageFactory,
SerializerInterface $serializer = null
?SerializerInterface $serializer = null
) {
parent::__construct('https://maps.googleapis.com/maps/api/elevation', $client, $messageFactory, $serializer);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Geocoder/GeocoderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class GeocoderService extends AbstractSerializableService
public function __construct(
HttpClient $client,
MessageFactory $messageFactory,
SerializerInterface $serializer = null
?SerializerInterface $serializer = null
) {
parent::__construct(
'https://maps.googleapis.com/maps/api/geocode',
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Geocoder/Request/GeocoderAddressRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function getBound()
return $this->bound;
}

public function setBound(Bound $bound = null)
public function setBound(?Bound $bound = null)
{
$this->bound = $bound;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Place/AbstractPlaceSerializableService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class AbstractPlaceSerializableService extends AbstractSerializableServ
public function __construct(
HttpClient $client,
MessageFactory $messageFactory,
SerializerInterface $serializer = null,
?SerializerInterface $serializer = null,
$context = null
) {
if (null !== $context) {
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Place/Detail/PlaceDetailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PlaceDetailService extends AbstractSerializableService
public function __construct(
HttpClient $client,
MessageFactory $messageFactory,
SerializerInterface $serializer = null
?SerializerInterface $serializer = null
) {
parent::__construct(
'https://maps.googleapis.com/maps/api/place/details',
Expand Down
8 changes: 4 additions & 4 deletions src/Service/Serializer/GoogleDateTimeNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function setDefaultContext(array $defaultContext): void
/**
* {@inheritdoc}
*/
public function normalize(mixed $object, string $format = null, array $context = []): float|int|bool|\ArrayObject|array|string|null
public function normalize(mixed $object, ?string $format = null, array $context = []): float|int|bool|\ArrayObject|array|string|null
{
if (!$object instanceof \DateTimeInterface) {
throw new InvalidArgumentException('The object must implement the "\DateTimeInterface".');
Expand All @@ -59,7 +59,7 @@ public function normalize(mixed $object, string $format = null, array $context =
/**
* {@inheritdoc}
*/
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof \DateTimeInterface;
}
Expand All @@ -71,7 +71,7 @@ public function supportsNormalization(mixed $data, string $format = null, array
*
* @throws NotNormalizableValueException
*/
public function denormalize($data, string $type, string $format = null, array $context = []): mixed
public function denormalize($data, string $type, ?string $format = null, array $context = []): mixed
{
$dateTimeFormat = $context[self::FORMAT_KEY] ?? null;
$timezone = $this->getTimezone($context);
Expand Down Expand Up @@ -114,7 +114,7 @@ public function denormalize($data, string $type, string $format = null, array $c
/**
* {@inheritdoc}
*/
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
return isset(self::SUPPORTED_TYPES[$type]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/TimeZone/TimeZoneService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TimeZoneService extends AbstractSerializableService
public function __construct(
HttpClient $client,
MessageFactory $messageFactory,
SerializerInterface $serializer = null
?SerializerInterface $serializer = null
) {
parent::__construct('https://maps.googleapis.com/maps/api/timezone', $client, $messageFactory, $serializer);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Helper/Formatter/FormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function testRenderContainerAssignment(
VariableAwareInterface $root,
$declaration,
$propertyPath = null,
VariableAwareInterface $object = null,
?VariableAwareInterface $object = null,
$semicolon = true,
$newLine = true,
$debug = false
Expand Down Expand Up @@ -275,7 +275,7 @@ public function testRenderContainerVariable(
$expected,
VariableAwareInterface $root,
$propertyPath = null,
VariableAwareInterface $object = null,
?VariableAwareInterface $object = null,
$debug = false
) {
$this->formatter->setDebug($debug);
Expand Down
4 changes: 2 additions & 2 deletions tests/Helper/Functional/AbstractApiFunctional.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected function assertContainerVariableExists(VariableAwareInterface $root, $
protected function assertSameContainerVariable(
VariableAwareInterface $root,
$propertyPath,
VariableAwareInterface $object = null,
?VariableAwareInterface $object = null,
$expected = null,
$formatter = null
) {
Expand Down Expand Up @@ -191,7 +191,7 @@ protected function createApiHelper()
private function getContainer(
VariableAwareInterface $root,
$propertyPath = null,
VariableAwareInterface $object = null
?VariableAwareInterface $object = null
) {
$variable = $root->getVariable().'_container';

Expand Down
2 changes: 1 addition & 1 deletion tests/Layer/LayerManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public function testRemoveKmlLayerWithAutoZoom()
/**
* @return MockObject|Map
*/
private function createMapMock(Bound $bound = null)
private function createMapMock(?Bound $bound = null)
{
$map = $this->createMock(Map::class);
$map
Expand Down
2 changes: 1 addition & 1 deletion tests/Overlay/MarkerClusterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private function createOverlayManagerMock(Map $map = null)
/**
* @return MockObject|Map
*/
private function createMapMock(Bound $bound = null)
private function createMapMock(?Bound $bound = null)
{
$map = $this->createMock(Map::class);
$map
Expand Down
2 changes: 1 addition & 1 deletion tests/Overlay/OverlayManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ public function testRemoveGroundOverlayWithAutoZoom()
/**
* @return MockObject|Map
*/
private function createMapMock(Bound $bound = null)
private function createMapMock(?Bound $bound = null)
{
$map = $this->createMock(Map::class);
$map
Expand Down

0 comments on commit e97a9a0

Please sign in to comment.