Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '8.1' ]
php-versions: [ '8.2' ]

runs-on: ubuntu-latest
steps:
# —— Github Checkout 🔎 ——————————————————————————————————————————————————
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -37,18 +37,25 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: [ '7.4', '8.0', '8.1' ]
symfony: [ '5.4', '6.0' ]
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]
symfony: [ '6.4', '7.4', '8.0', '8.1' ]
exclude:
- php-versions: '7.4'
symfony: '6.0'
# Symfony 8.x requires PHP >= 8.4
- php-versions: '8.2'
symfony: '8.0'
- php-versions: '8.3'
symfony: '8.0'
- php-versions: '8.2'
symfony: '8.1'
- php-versions: '8.3'
symfony: '8.1'

runs-on: ${{ matrix.operating-system }}

steps:
# —— Git Checkout PR branch ——————————————————————————————————————————
- name: Git Checkout PR branch (${{ github.ref }})
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -65,23 +72,24 @@ jobs:
# —— Composer cache ————————————————————————————————————————————————————
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache composer dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ matrix.symfony }}
restore-keys: ${{ runner.os }}-composer-

# —— Install composer dependencies —————————————————————————————————————
- name: Install Composer dependencies
env:
COMPOSER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
composer global require --no-interaction --no-progress symfony/flex:^1.11
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-interaction --no-progress symfony/flex
composer config extra.symfony.require "${{ matrix.symfony }}.*"
composer install --no-progress --no-scripts -q
composer update --no-progress --no-scripts

# # —— PHPStan ——————————————————————————————————————————————————————————
# - name: PHPStan (PHP Static Analysis)
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
"php": "^8.2",
"ext-json": "*",
"phpdocumentor/reflection-docblock": "^5.3",
"symfony/debug-bundle": "^6.4|^7.0",
"symfony/http-client": "^6.4|^7.0",
"symfony/property-access": "^6.4|^7.0",
"symfony/property-info": "^6.4|^7.0",
"symfony/serializer": "^6.4|^7.0"
"symfony/debug-bundle": "^6.4|^7.4|^8.0",
"symfony/http-client": "^6.4|^7.4|^8.0",
"symfony/property-access": "^6.4|^7.4|^8.0",
"symfony/property-info": "^6.4|^7.4|^8.0",
"symfony/serializer": "^6.4|^7.4|^8.0"
},
"require-dev" : {
"friendsofphp/php-cs-fixer": "^3.15",
"phpstan/phpstan": "^1.8.7",
"phpunit/phpunit": "^9.5|^10.0",
"symfony/var-dumper": "^6.4|^7.0"
"symfony/var-dumper": "^6.4|^7.4|^8.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class Connection

private ?HttpClientInterface $client = null;

public function __construct(string $uri = null)
public function __construct(?string $uri = null)
{
if ($uri) {
$this->uri = $uri;
Expand Down
4 changes: 2 additions & 2 deletions src/Serializer/Normalizer/ArrivalNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ final class ArrivalNormalizer implements DenormalizerInterface
*
* @throws \Exception
*/
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): \DateTimeImmutable
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): \DateTimeImmutable
{
return DateTimeUtil::fromUTC(new \DateTimeImmutable('@'.$data));
}

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 'DateTimeImmutable' === $type && is_int($data) && $data > 604800;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Serializer/Normalizer/LocationNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class LocationNormalizer implements NormalizerInterface, DenormalizerInter
/**
* @param Location $object
*/
public function normalize(mixed $object, string $format = null, array $context = []): array
public function normalize(mixed $object, ?string $format = null, array $context = []): array
{
return [
$object->lon,
Expand All @@ -24,23 +24,23 @@ public function normalize(mixed $object, string $format = null, array $context =
/**
* @param Location $data
*/
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 Location;
}

/**
* @param array $data
*/
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): Location
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): Location
{
return new Location($data[0], $data[1]);
}

/**
* @param array $data
*/
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 Location::class === $type;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Serializer/Normalizer/TimeWindowNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class TimeWindowNormalizer implements NormalizerInterface
/**
* @param TimeWindowInterface $object
*/
public function normalize(mixed $object, string $format = null, array $context = []): ?array
public function normalize(mixed $object, ?string $format = null, array $context = []): ?array
{
if ($object instanceof AbsoluteTimeWindow) {
return [
Expand All @@ -37,7 +37,7 @@ public function normalize(mixed $object, string $format = null, array $context =
/**
* @param TimeWindowInterface $data
*/
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 TimeWindowInterface;
}
Expand Down
Loading