Skip to content

Commit d1c3a2d

Browse files
committed
feat: Symfony 8 and PHP 8.5 support
1 parent 3fcee4e commit d1c3a2d

File tree

11 files changed

+32
-54
lines changed

11 files changed

+32
-54
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,7 @@ on:
88

99
jobs:
1010
tests:
11-
name: PHP ${{ matrix.php }}, SF ${{ matrix.symfony }} - ${{ matrix.deps }}
12-
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
php: [8.1, 8.2, 8.3, 8.4]
16-
deps: [highest]
17-
symfony: [6.4.*, 7.2.*, 7.3.*]
18-
include:
19-
- php: 8.1
20-
deps: lowest
21-
symfony: '*'
22-
exclude:
23-
- php: 8.1
24-
symfony: 7.2.*
25-
- php: 8.1
26-
symfony: 7.3.*
27-
steps:
28-
- uses: zenstruck/.github/actions/php-test-symfony@main
29-
with:
30-
php: ${{ matrix.php }}
31-
symfony: ${{ matrix.symfony }}
32-
deps: ${{ matrix.deps }}
11+
uses: zenstruck/.github/.github/workflows/php-test-symfony.yml@main
3312

3413
code-coverage:
3514
uses: zenstruck/.github/.github/workflows/php-coverage-codecov.yml@main
@@ -39,16 +18,14 @@ jobs:
3918

4019
sca:
4120
uses: zenstruck/.github/.github/workflows/php-stan.yml@main
42-
with:
43-
php: 8.2
4421

4522
fixcs:
4623
name: Run php-cs-fixer
4724
needs: sync-with-template
4825
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags') && github.repository_owner == 'zenstruck'
4926
runs-on: ubuntu-latest
5027
steps:
51-
- uses: zenstruck/.github@php-cs-fixer
28+
- uses: zenstruck/.github/actions/php-cs-fixer@main
5229
with:
5330
php: 8.1
5431
key: ${{ secrets.GPG_PRIVATE_KEY }}
@@ -59,7 +36,7 @@ jobs:
5936
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags') && github.repository_owner == 'zenstruck'
6037
runs-on: ubuntu-latest
6138
steps:
62-
- uses: zenstruck/.github@sync-with-template
39+
- uses: zenstruck/.github/actions/sync-with-template@main
6340
with:
6441
key: ${{ secrets.GPG_PRIVATE_KEY }}
6542
token: ${{ secrets.COMPOSER_TOKEN }}

composer.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"zenstruck/temp-file": "^1.2.1"
2020
},
2121
"require-dev": {
22-
"doctrine/doctrine-bundle": "^2.8",
22+
"doctrine/doctrine-bundle": "^2.8|^3.0",
2323
"doctrine/orm": "^2.14|^3.0",
2424
"league/flysystem-async-aws-s3": "^3.10",
2525
"league/flysystem-ftp": "^3.10",
@@ -32,18 +32,19 @@
3232
"phpstan/phpstan": "^2.0",
3333
"phpunit/phpunit": "^9.6.18",
3434
"srwiez/thumbhash": "^1.2",
35-
"symfony/browser-kit": "^6.4|^7.0",
36-
"symfony/form": "^6.4|^7.0",
37-
"symfony/framework-bundle": "^6.4|^7.0",
38-
"symfony/mime": "^6.4|^7.0",
39-
"symfony/phpunit-bridge": "^6.1|^7.0",
40-
"symfony/serializer": "^6.4|^7.0",
41-
"symfony/stopwatch": "^6.4|^7.0",
42-
"symfony/string": "^6.4|^7.0",
43-
"symfony/twig-bundle": "^6.4|^7.0",
44-
"symfony/validator": "^6.4|^7.0",
45-
"symfony/var-dumper": "^6.4|^7.0",
46-
"symfony/yaml": "^6.4|^7.0",
35+
"symfony/browser-kit": "^6.4|^7.0|^8.0",
36+
"symfony/form": "^6.4|^7.0|^8.0",
37+
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
38+
"symfony/mime": "^6.4|^7.0|^8.0",
39+
"symfony/phpunit-bridge": "^6.4|^7.0|^8.0",
40+
"symfony/serializer": "^6.4|^7.0|^8.0",
41+
"symfony/stopwatch": "^6.4|^7.0|^8.0",
42+
"symfony/string": "^6.4|^7.0|^8.0",
43+
"symfony/twig-bundle": "^6.4|^7.0|^8.0",
44+
"symfony/validator": "^6.4|^7.0|^8.0",
45+
"symfony/var-dumper": "^6.4|^7.0|^8.0",
46+
"symfony/var-exporter": "^6.4|^7.0|^8.0",
47+
"symfony/yaml": "^6.4|^7.0|^8.0",
4748
"twig/twig": "^3.6",
4849
"zenstruck/assert": "^1.2",
4950
"zenstruck/console-test": "^1.4",

src/Filesystem/Doctrine/MappingManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function load(object|iterable $object): object|iterable
4747
}
4848
}
4949

50-
return $object;
50+
return $object; // @phpstan-ignore return.type
5151
}
5252

5353
if (isset($this->loaded[$object])) {

src/Filesystem/Node/File/FlysystemFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function stream(): Stream
5858

5959
public function checksum(?string $algo = null): string
6060
{
61-
return $this->cache['checksum'][$algo] ??= $this->operator->checksum($this->path(), $algo ? ['checksum_algo' => $algo] : []);
61+
return $this->cache['checksum'][$algo ?? '_auto'] ??= $this->operator->checksum($this->path(), $algo ? ['checksum_algo' => $algo] : []);
6262
}
6363

6464
public function publicUrl(array $config = []): string

src/Filesystem/Symfony/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function getConfigTreeBuilder(): TreeBuilder
3333
{
3434
$treeBuilder = new TreeBuilder('zenstruck_filesystem');
3535

36-
$treeBuilder->getRootNode() // @phpstan-ignore method.notFound
36+
$treeBuilder->getRootNode()
3737
->validate()
3838
->ifTrue(function(array $v) {
3939
if (null === $v['default_filesystem']) {

src/Filesystem/Symfony/DependencyInjection/ZenstruckFilesystemExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ private function registerFilesystem(string $name, array $config, ContainerBuilde
406406
;
407407

408408
if ($config['lazy']) {
409-
$flysystemDef
410-
->setLazy(true)
411-
->addTag('proxy', ['interface' => Flysystem::class])
412-
;
409+
// $flysystemDef
410+
// ->setLazy(true)
411+
// ->addTag('proxy', ['interface' => Flysystem::class])
412+
// ;
413413
}
414414

415415
$container->register($filesystemId = 'zenstruck_filesystem.filesystem.'.$name, FlysystemFilesystem::class)

src/Filesystem/Symfony/Serializer/NodeNormalizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ public function __construct(private ContainerInterface $container)
4646
/**
4747
* @param Node $object
4848
*/
49-
public function normalize(mixed $object, ?string $format = null, array $context = []): array|string // @phpstan-ignore missingType.iterableValue, missingType.iterableValue
49+
public function normalize(mixed $object, ?string $format = null, array $context = []): array|string // @phpstan-ignore missingType.iterableValue
5050
{
5151
return Mapping::fromArray($context)->serialize($object);
5252
}
5353

54-
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool // @phpstan-ignore missingType.iterableValue
54+
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
5555
{
5656
return $data instanceof Node && !$data instanceof PendingFile;
5757
}
5858

5959
/**
6060
* @param string $data
6161
*/
62-
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): Node // @phpstan-ignore missingType.iterableValue
62+
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): Node
6363
{
6464
if (!\is_string($data) && !\is_array($data)) {
6565
throw new UnexpectedValueException('Data must be a string or array.');
@@ -94,7 +94,7 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a
9494
return $node;
9595
}
9696

97-
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool // @phpstan-ignore missingType.iterableValue
97+
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
9898
{
9999
return isset(self::TYPE_MAP[$type]);
100100
}

src/Filesystem/Test/Node/Mock.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public static function pendingFile(?string $filename = null, ?string $extension
3535
}
3636

3737
/**
38+
* @param int<1, max> $width
39+
* @param int<1, max> $height
3840
* @param ?string $filename Optional filename to use (must not include directory separators)
3941
*/
4042
public static function pendingImage(int $width = 10, int $height = 10, string $type = 'png', ?string $filename = null): PendingImage

tests/Fixtures/Controller/ArgumentResolverController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Zenstruck\Tests\Fixtures\Controller;
1313

1414
use Symfony\Component\HttpFoundation\Response;
15-
use Symfony\Component\Routing\Annotation\Route;
15+
use Symfony\Component\Routing\Attribute\Route;
1616
use Zenstruck\Filesystem\Attribute\PendingUploadedFile;
1717
use Zenstruck\Filesystem\Attribute\UploadedFile;
1818
use Zenstruck\Filesystem\Node\File;

tests/Fixtures/Controller/ValidatedArgumentResolverController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Zenstruck\Tests\Fixtures\Controller;
1313

1414
use Symfony\Component\HttpFoundation\Response;
15-
use Symfony\Component\Routing\Annotation\Route;
15+
use Symfony\Component\Routing\Attribute\Route;
1616
use Zenstruck\Filesystem\Attribute\PendingUploadedFile;
1717
use Zenstruck\Filesystem\Node\File;
1818
use Zenstruck\Filesystem\Symfony\Validator\PendingFileConstraint;

0 commit comments

Comments
 (0)