Skip to content

Commit 983a908

Browse files
committed
feature thephpleague#84 Add Symfony 6 support (AbdelilahJabri, tgalopin)
This PR was merged into the master branch. Discussion ---------- Add Symfony 6 support Commits ------- d336d87 Fix tests for Symfony 6 48ae2f0 Fix and improve CI de58094 Add Symfony 6 support
2 parents 320a440 + d336d87 commit 983a908

10 files changed

Lines changed: 70 additions & 44 deletions

File tree

.github/workflows/test.yaml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,74 @@ jobs:
1313
- uses: actions/checkout@master
1414
- uses: shivammathur/setup-php@v2
1515
with:
16-
php-version: '7.4'
16+
php-version: '8.0'
17+
coverage: none
1718
- name: php-cs-fixer
1819
run: |
19-
wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.4/php-cs-fixer.phar -q
20+
wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.19.0/php-cs-fixer.phar -q
2021
php php-cs-fixer.phar fix --dry-run --diff
2122
22-
tests-php-7-2-symfony-4-2:
23+
tests-php-7-2-symfony-4-4:
2324
runs-on: ubuntu-latest
2425
env:
25-
SYMFONY_VERSION: 4.2.*
26+
SYMFONY_VERSION: 4.4.*
2627
steps:
2728
- uses: actions/checkout@master
2829
- uses: shivammathur/setup-php@v2
2930
with:
3031
php-version: '7.2'
32+
coverage: none
3133
- name: PHPUnit
3234
run: |
3335
composer require --no-update symfony/config=$SYMFONY_VERSION symfony/http-kernel=$SYMFONY_VERSION symfony/dependency-injection=$SYMFONY_VERSION symfony/options-resolver=$SYMFONY_VERSION
3436
composer require --no-update --dev symfony/framework-bundle=$SYMFONY_VERSION symfony/yaml=$SYMFONY_VERSION
3537
composer update --prefer-lowest --prefer-dist --no-interaction --no-ansi --no-progress
3638
php vendor/bin/simple-phpunit
3739
38-
tests-php-7-4-symfony-5-0:
40+
tests-php-7-4-symfony-5-3:
3941
runs-on: ubuntu-latest
4042
env:
41-
SYMFONY_VERSION: 5.0.*
43+
SYMFONY_VERSION: 5.3.*
4244
steps:
4345
- uses: actions/checkout@master
4446
- uses: shivammathur/setup-php@v2
4547
with:
46-
php-version: '7.3'
48+
php-version: '7.4'
49+
coverage: none
4750
- name: PHPUnit
4851
run: |
4952
composer require --no-update symfony/config=$SYMFONY_VERSION symfony/http-kernel=$SYMFONY_VERSION symfony/dependency-injection=$SYMFONY_VERSION symfony/options-resolver=$SYMFONY_VERSION
5053
composer require --no-update --dev symfony/framework-bundle=$SYMFONY_VERSION symfony/yaml=$SYMFONY_VERSION
5154
composer update --prefer-dist --no-interaction --no-ansi --no-progress
5255
php vendor/bin/simple-phpunit
5356
54-
tests-php-8-0-symfony-5-2:
57+
tests-php-8-0-symfony-5-4:
5558
runs-on: ubuntu-latest
5659
env:
57-
SYMFONY_VERSION: 5.2.*
60+
SYMFONY_VERSION: 5.4.*
5861
steps:
5962
- uses: actions/checkout@master
6063
- uses: shivammathur/setup-php@v2
6164
with:
6265
php-version: '8.0'
66+
coverage: none
67+
- name: PHPUnit
68+
run: |
69+
composer require --no-update symfony/config=$SYMFONY_VERSION symfony/http-kernel=$SYMFONY_VERSION symfony/dependency-injection=$SYMFONY_VERSION symfony/options-resolver=$SYMFONY_VERSION
70+
composer require --no-update --dev symfony/framework-bundle=$SYMFONY_VERSION symfony/yaml=$SYMFONY_VERSION
71+
composer update --prefer-dist --no-interaction --no-ansi --no-progress
72+
php vendor/bin/simple-phpunit
73+
74+
tests-php-8-1-symfony-6-0:
75+
runs-on: ubuntu-latest
76+
env:
77+
SYMFONY_VERSION: 6.0.*
78+
steps:
79+
- uses: actions/checkout@master
80+
- uses: shivammathur/setup-php@v2
81+
with:
82+
php-version: '8.1'
83+
coverage: none
6384
- name: PHPUnit
6485
run: |
6586
composer require --no-update symfony/config=$SYMFONY_VERSION symfony/http-kernel=$SYMFONY_VERSION symfony/dependency-injection=$SYMFONY_VERSION symfony/options-resolver=$SYMFONY_VERSION

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"require": {
2323
"php": ">=7.2",
2424
"league/flysystem": "^2.0",
25-
"symfony/config": "^4.2|^5.0",
26-
"symfony/http-kernel": "^4.2|^5.0",
27-
"symfony/dependency-injection": "^4.2|^5.0",
28-
"symfony/options-resolver": "^4.2|^5.0"
25+
"symfony/config": "^4.2|^5.0|^6.0",
26+
"symfony/http-kernel": "^4.2|^5.0|^6.0",
27+
"symfony/dependency-injection": "^4.2|^5.0|^6.0",
28+
"symfony/options-resolver": "^4.2|^5.0|^6.0"
2929
},
3030
"require-dev": {
3131
"league/flysystem-async-aws-s3": "^2.0",
@@ -34,11 +34,11 @@
3434
"league/flysystem-google-cloud-storage": "^2.0",
3535
"league/flysystem-memory": "^2.0",
3636
"league/flysystem-sftp": "^2.0",
37-
"symfony/dotenv": "^4.2|^5.0",
38-
"symfony/framework-bundle": "^4.2|^5.0",
37+
"symfony/dotenv": "^4.2|^5.0|^6.0",
38+
"symfony/framework-bundle": "^4.2|^5.0|^6.0",
3939
"symfony/phpunit-bridge": "^5.2",
40-
"symfony/var-dumper": "^4.1|^5.0",
41-
"symfony/yaml": "^4.2|^5.0"
40+
"symfony/var-dumper": "^4.1|^5.0|^6.0",
41+
"symfony/yaml": "^4.2|^5.0|^6.0"
4242
},
4343
"conflict": {
4444
"league/flysystem-cached-adapter": "<1.0.9"

phpunit.xml.dist

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
43
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
65
backupGlobals="false"
76
colors="true"
87
bootstrap="vendor/autoload.php">
9-
<php>
10-
<ini name="error_reporting" value="-1" />
11-
<env name="SHELL_VERBOSITY" value="-1" />
12-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="9999" />
13-
</php>
8+
<php>
9+
<ini name="error_reporting" value="-1"/>
10+
<env name="SHELL_VERBOSITY" value="-1"/>
11+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="9999"/>
12+
</php>
1413

15-
<testsuites>
16-
<testsuite name="FlysystemBundle Test Suite">
17-
<directory>tests/</directory>
18-
</testsuite>
19-
</testsuites>
14+
<testsuites>
15+
<testsuite name="FlysystemBundle Test Suite">
16+
<directory>tests/</directory>
17+
</testsuite>
18+
</testsuites>
2019

21-
<filter>
22-
<whitelist>
23-
<directory>./src/</directory>
24-
</whitelist>
25-
</filter>
20+
<coverage>
21+
<include>
22+
<directory>./src/</directory>
23+
</include>
24+
</coverage>
2625
</phpunit>

src/Adapter/Builder/LocalAdapterDefinitionBuilder.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,16 @@ protected function configureDefinition(Definition $definition, array $options)
7070
$definition->setArgument(1,
7171
(new Definition(PortableVisibilityConverter::class))
7272
->setFactory([PortableVisibilityConverter::class, 'fromArray'])
73-
->addArgument($options['permissions'])
73+
->addArgument([
74+
'file' => [
75+
'public' => (int) $options['permissions']['file']['public'],
76+
'private' => (int) $options['permissions']['file']['private'],
77+
],
78+
'dir' => [
79+
'public' => (int) $options['permissions']['dir']['public'],
80+
'private' => (int) $options['permissions']['dir']['private'],
81+
],
82+
])
7483
->setShared(false)
7584
);
7685
$definition->setArgument(2, $options['lock']);

src/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
class Configuration implements ConfigurationInterface
2323
{
24-
public function getConfigTreeBuilder()
24+
public function getConfigTreeBuilder(): TreeBuilder
2525
{
2626
$treeBuilder = new TreeBuilder('flysystem');
2727
$rootNode = $treeBuilder->getRootNode();

tests/Kernel/AppKernelTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
trait AppKernelTrait
1515
{
16-
public function getCacheDir()
16+
public function getCacheDir(): string
1717
{
1818
return $this->createTmpDir('cache');
1919
}
2020

21-
public function getLogDir()
21+
public function getLogDir(): string
2222
{
2323
return $this->createTmpDir('logs');
2424
}

tests/Kernel/EmptyAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class EmptyAppKernel extends Kernel
2020
{
2121
use AppKernelTrait;
2222

23-
public function registerBundles()
23+
public function registerBundles(): iterable
2424
{
2525
return [new FlysystemBundle()];
2626
}

tests/Kernel/FlysystemAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FlysystemAppKernel extends Kernel
2424

2525
private $adapterClients = [];
2626

27-
public function registerBundles()
27+
public function registerBundles(): iterable
2828
{
2929
return [new FrameworkBundle(), new FlysystemBundle()];
3030
}

tests/Kernel/FrameworkAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class FrameworkAppKernel extends Kernel
2121
{
2222
use AppKernelTrait;
2323

24-
public function registerBundles()
24+
public function registerBundles(): iterable
2525
{
2626
return [new FrameworkBundle(), new FlysystemBundle()];
2727
}

tests/Kernel/config/flysystem.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,3 @@ flysystem:
6969
privateKey: 'path/to/or/contents/of/privatekey'
7070
root: '/path/to/root'
7171
timeout: 10
72-
directoryPerm: 0755
73-
permPrivate: 0700
74-
permPublic: 0744

0 commit comments

Comments
 (0)