Skip to content

Commit 34d7ef1

Browse files
committed
Support PHP 8.5 and Symfony 8
1 parent c91edf2 commit 34d7ef1

10 files changed

Lines changed: 106 additions & 146 deletions

File tree

.github/workflows/continuous-integration.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
php-version:
2525
- 8.3
2626
- 8.4
27+
- 8.5
2728
dependencies:
2829
- "highest"
2930
symfony_version:
@@ -36,29 +37,39 @@ jobs:
3637
- symfony_version: "6.4.*"
3738
php-version: "8.4"
3839
dependencies: "highest"
40+
- symfony_version: "6.4.*"
41+
php-version: "8.5"
42+
dependencies: "highest"
43+
44+
# Test against latest Symfony 7.4
45+
- symfony_version: "7.4.*"
46+
php-version: "8.3"
47+
dependencies: "highest"
48+
- symfony_version: "7.4.*"
49+
php-version: "8.4"
50+
dependencies: "highest"
51+
- symfony_version: "7.4.*"
52+
php-version: "8.5"
53+
dependencies: "highest"
3954

4055
# Test against the highest dependencies
4156
- php-version: "8.3"
4257
dependencies: "highest"
4358
- php-version: "8.4"
4459
dependencies: "highest"
60+
- php-version: "8.5"
61+
dependencies: "highest"
4562

4663
steps:
4764
- name: Checkout code
48-
uses: actions/checkout@v4
65+
uses: actions/checkout@v6
4966

5067
- name: Setup PHP
5168
uses: shivammathur/setup-php@v2
5269
with:
53-
php-version: ${{ matrix.php-versions }}
70+
php-version: ${{ matrix.php-version }}
5471
coverage: pcov
55-
ini-values: "zend.assertions=1"
56-
57-
- name: "symfony/flex is required to install the correct symfony version"
58-
if: ${{ matrix.symfony_version }}
59-
run: |
60-
composer global config --no-plugins allow-plugins.symfony/flex true
61-
composer global require symfony/flex
72+
tools: flex
6273

6374
- name: "Configure Symfony version for symfony/flex"
6475
if: ${{ matrix.symfony_version }}

Makefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,10 @@ coding-standard-fix:
2020
.PHONY: static-analysis
2121
static-analysis: ## Run static analysis checks
2222
./vendor/bin/phpstan --configuration=config/phpstan.neon --memory-limit=256M
23-
./vendor/bin/psalm --config config/psalm.xml --no-cache
2423

2524
.PHONY: static-analysis-update
2625
static-analysis-update: ## Update static analysis baselines
2726
./vendor/bin/phpstan --configuration=config/phpstan.neon --generate-baseline=config/phpstan-baseline.neon --allow-empty-baseline
28-
./vendor/bin/psalm --config config/psalm.xml --set-baseline=psalm.baseline.xml --show-info=true --no-cache
29-
30-
.PHONY: security-analysis
31-
security-analysis: ## Run static analysis security checks
32-
./vendor/bin/psalm -c config/psalm.xml --taint-analysis
3327

3428
.PHONY: unit-tests
3529
unit-tests: ## Run unit test suite
@@ -40,4 +34,4 @@ composer-validate:
4034
./vendor/bin/composer validate
4135

4236
.PHONY: check
43-
check: coding-standard-check static-analysis security-analysis unit-tests ## Run all checks for local development iterations
37+
check: coding-standard-check static-analysis unit-tests ## Run all checks for local development iterations

composer.json

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,26 @@
1717
],
1818
"homepage": "https://github.com/protung/cloudinary-bundle",
1919
"require": {
20-
"php": "~8.3.0 || ~8.4.0",
21-
"azjezz/psl": "^3.0.0",
20+
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
21+
"azjezz/psl": "^3.0.0 || ^4.0.0",
2222
"cloudinary/cloudinary_php": "^3.1.1",
23-
"symfony/console": "^6.4 || ^7.2",
24-
"symfony/finder": "^6.4 || ^7.2",
25-
"symfony/framework-bundle": "^6.4 || ^7.2",
26-
"symfony/yaml": "^6.4 || ^7.2"
23+
"symfony/console": "^6.4 || ^7.2 || ^8.0",
24+
"symfony/finder": "^6.4 || ^7.2 || ^8.0",
25+
"symfony/framework-bundle": "^6.4 || ^7.2 || ^8.0",
26+
"symfony/yaml": "^6.4 || ^7.2 || ^8.0"
2727
},
2828
"require-dev": {
29-
"doctrine/coding-standard": "^13.0",
30-
"ergebnis/composer-normalize": "^2.47.0",
31-
"php-standard-library/phpstan-extension": "^2.0.0",
32-
"php-standard-library/psalm-plugin": "^2.3",
33-
"phpstan/phpstan": "^2.1.17",
29+
"doctrine/coding-standard": "^14.0.0",
30+
"ergebnis/composer-normalize": "^2.48.2",
31+
"php-standard-library/phpstan-extension": "^2.0.2",
32+
"phpstan/phpstan": "^2.1.33",
3433
"phpstan/phpstan-deprecation-rules": "^2.0.3",
35-
"phpstan/phpstan-phpunit": "^2.0.6",
36-
"phpstan/phpstan-strict-rules": "^2.0.4",
37-
"phpstan/phpstan-symfony": "^2.0.6",
38-
"phpunit/phpunit": "^12.2.6",
39-
"psalm/plugin-phpunit": "^0.19.5",
34+
"phpstan/phpstan-phpunit": "^2.0.10",
35+
"phpstan/phpstan-strict-rules": "^2.0.7",
36+
"phpstan/phpstan-symfony": "^2.0.9",
37+
"phpunit/phpunit": "^12.5.1",
4038
"roave/security-advisories": "dev-latest",
41-
"twig/twig": "^3.21",
42-
"vimeo/psalm": "^6.12.1"
39+
"twig/twig": "^3.22.1"
4340
},
4441
"suggest": {
4542
"twig/twig": "Allow to use the cloudinary_url function/filter"

config/phpstan-baseline.neon

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,61 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
4+
rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.'
55
identifier: foreach.nonIterable
66
count: 1
77
path: ../src/Command/DeleteCommand.php
88

99
-
10-
message: '#^Parameter \#1 \$prefix of method Cloudinary\\Api\\Admin\\AdminApi\:\:deleteAssetsByPrefix\(\) expects string, mixed given\.$#'
10+
rawMessage: 'Parameter #1 $prefix of method Cloudinary\Api\Admin\AdminApi::deleteAssetsByPrefix() expects string, mixed given.'
1111
identifier: argument.type
1212
count: 1
1313
path: ../src/Command/DeleteCommand.php
1414

1515
-
16-
message: '#^Parameter \#1 \$publicIds of method Cloudinary\\Api\\Admin\\AdminApi\:\:deleteAssets\(\) expects array\|string, mixed given\.$#'
16+
rawMessage: 'Parameter #1 $publicIds of method Cloudinary\Api\Admin\AdminApi::deleteAssets() expects array|string, mixed given.'
1717
identifier: argument.type
1818
count: 1
1919
path: ../src/Command/DeleteCommand.php
2020

2121
-
22-
message: '#^Parameter \#2 \.\.\.\$args of function Psl\\Str\\format expects float\|int\|string, mixed given\.$#'
22+
rawMessage: 'Parameter #2 ...$args of function Psl\Str\format expects float|int|string, mixed given.'
2323
identifier: argument.type
2424
count: 2
2525
path: ../src/Command/DeleteCommand.php
2626

2727
-
28-
message: '#^Parameter \#1 \$publicId of method Cloudinary\\Api\\Admin\\AdminApi\:\:asset\(\) expects string, mixed given\.$#'
28+
rawMessage: 'Parameter #1 $publicId of method Cloudinary\Api\Admin\AdminApi::asset() expects string, mixed given.'
2929
identifier: argument.type
3030
count: 1
3131
path: ../src/Command/InfoCommand.php
3232

3333
-
34-
message: '#^Parameter \#2 \$derivedResources of method Speicher210\\CloudinaryBundle\\Command\\InfoCommand\:\:renderDerivedResources\(\) expects array\<array\{id\: string, format\: string, bytes\: int, transformation\: string, url\: string\}\>, mixed given\.$#'
34+
rawMessage: 'Parameter #2 $derivedResources of method Speicher210\CloudinaryBundle\Command\InfoCommand::renderDerivedResources() expects array<array{id: string, format: string, bytes: int, transformation: string, url: string}>, mixed given.'
3535
identifier: argument.type
3636
count: 1
3737
path: ../src/Command/InfoCommand.php
3838

3939
-
40-
message: '#^Parameter \#1 \$dirs of method Symfony\\Component\\Finder\\Finder\:\:in\(\) expects array\<string\>\|string, mixed given\.$#'
40+
rawMessage: 'Parameter #1 $dirs of method Symfony\Component\Finder\Finder::in() expects array<string>|string, mixed given.'
4141
identifier: argument.type
4242
count: 1
4343
path: ../src/Command/UploadCommand.php
4444

4545
-
46-
message: '#^Parameter \#1 \$node of function Psl\\Filesystem\\get_filename expects non\-empty\-string, string given\.$#'
46+
rawMessage: 'Parameter #1 $node of function Psl\Filesystem\get_filename expects non-empty-string, string given.'
4747
identifier: argument.type
4848
count: 1
4949
path: ../src/Command/UploadCommand.php
5050

5151
-
52-
message: '#^Parameter \#1 \$patterns of method Symfony\\Component\\Finder\\Finder\:\:name\(\) expects array\<string\>\|string, mixed given\.$#'
52+
rawMessage: 'Parameter #1 $patterns of method Symfony\Component\Finder\Finder::name() expects array<string>|string, mixed given.'
5353
identifier: argument.type
5454
count: 1
5555
path: ../src/Command/UploadCommand.php
56+
57+
-
58+
rawMessage: 'Method Speicher210\CloudinaryBundle\DependencyInjection\Configuration::getConfigTreeBuilder() return type with generic class Symfony\Component\Config\Definition\Builder\TreeBuilder does not specify its types: T'
59+
identifier: missingType.generics
60+
count: 1
61+
path: ../src/DependencyInjection/Configuration.php

config/psalm.baseline.xml

Lines changed: 0 additions & 33 deletions
This file was deleted.

config/psalm.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/DependencyInjection/Speicher210CloudinaryExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ final class Speicher210CloudinaryExtension extends ConfigurableExtension
1919
#[Override]
2020
protected function loadInternal(array $mergedConfig, ContainerBuilder $container): void
2121
{
22-
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
23-
$loader->load('services.xml');
22+
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
23+
$loader->load('services.yaml');
2424

2525
$container
2626
->getDefinition(CloudinaryFactory::class)

src/Factory/CloudinaryFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
use function array_key_exists;
1111
use function parse_url;
1212

13-
final class CloudinaryFactory
13+
final readonly class CloudinaryFactory
1414
{
15-
private readonly Configuration $configuration;
15+
private Configuration $configuration;
1616

1717
/**
1818
* @param array{url?: string, cloud_name?: string, access_identifier?: array{api_key: string, api_secret: string}, secure?: bool} $config

src/Resources/config/services.xml

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/Resources/config/services.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
services:
2+
Speicher210\CloudinaryBundle\Factory\CloudinaryFactory:
3+
public: false
4+
arguments:
5+
- [ ]
6+
7+
speicher210_cloudinary.cloudinary:
8+
class: Speicher210\CloudinaryBundle\Cloudinary\Cloudinary
9+
public: true
10+
factory: [ '@Speicher210\CloudinaryBundle\Factory\CloudinaryFactory', 'createCloudinary' ]
11+
12+
Cloudinary\Cloudinary:
13+
alias: speicher210_cloudinary.cloudinary
14+
public: true
15+
16+
speicher210_cloudinary.uploader:
17+
class: Speicher210\CloudinaryBundle\Cloudinary\Uploader
18+
public: true
19+
factory: [ '@speicher210_cloudinary.cloudinary', 'uploadApi' ]
20+
21+
speicher210_cloudinary.admin:
22+
class: Speicher210\CloudinaryBundle\Cloudinary\Admin
23+
public: true
24+
factory: [ '@speicher210_cloudinary.cloudinary', 'adminApi' ]
25+
26+
twig.extension.cloudinary:
27+
class: Speicher210\CloudinaryBundle\Twig\Extension\CloudinaryExtension
28+
public: true
29+
arguments:
30+
- '@speicher210_cloudinary.cloudinary'
31+
tags:
32+
- { name: 'twig.extension' }
33+
34+
Speicher210\CloudinaryBundle\Command\DeleteCommand:
35+
arguments:
36+
- '@speicher210_cloudinary.admin'
37+
tags:
38+
- { name: 'console.command' }
39+
40+
Speicher210\CloudinaryBundle\Command\InfoCommand:
41+
arguments:
42+
- '@speicher210_cloudinary.admin'
43+
tags:
44+
- { name: 'console.command' }
45+
46+
Speicher210\CloudinaryBundle\Command\UploadCommand:
47+
arguments:
48+
- '@speicher210_cloudinary.uploader'
49+
tags:
50+
- { name: 'console.command' }
51+

0 commit comments

Comments
 (0)