Skip to content

Commit

Permalink
Drop support fot PHP < 8.1 (#297)
Browse files Browse the repository at this point in the history
Co-authored-by: Christopher Georg <[email protected]>
  • Loading branch information
Chris53897 and Chris8934 authored Mar 14, 2024
1 parent d9222b3 commit 76949b0
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 83 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: 8.0
php-version: 8.1
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo, zlib
coverage: none

Expand All @@ -36,8 +36,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.0, 8.1, 8.2, 8.3]
symfony: [4.4, 5.4, 6.0, 7.0]
php: [8.1, 8.2, 8.3]
symfony: [5.4, 6.0, 7.0]
exclude:
- symfony: 7.0
php: 8.0
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: 8.0
php-version: 8.1
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo_mysql, zlib
coverage: none

Expand Down
30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,33 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"league/flysystem": "^2.0 || ^3.0",
"symfony/config": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/http-kernel": "^4.4 || ^5.3 || ^6.0 || ^7.0"
"symfony/config": "^5.4 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
"ext-simplexml": "*",
"friendsofphp/php-cs-fixer": "^2.16 || ^3.5",
"friendsofphp/php-cs-fixer": "^3.51",
"league/flysystem-async-aws-s3": "^2.0 || ^3.0",
"league/flysystem-aws-s3-v3": "^2.0 || ^3.0",
"league/flysystem-ftp": "^2.0 || ^3.0",
"league/flysystem-google-cloud-storage": "^2.0 || ^3.0",
"league/flysystem-memory": "^2.0 || ^3.0",
"league/flysystem-sftp-v3": "^2.0 || ^3.0",
"league/flysystem-azure-blob-storage": "^3.0",
"phpstan/phpstan": "^1.4",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.6.17",
"royvoetman/flysystem-gitlab-storage": "^2.0 || ^3.0",
"symfony/asset": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/browser-kit": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/finder": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^6.0 || ^7.0",
"symfony/templating": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/translation": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/yaml": "^4.4 || ^5.3 || ^6.0 || ^7.0"
"symfony/asset": "^5.4 || ^6.0 || ^7.0",
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",
"symfony/finder": "^5.4 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^7.0",
"symfony/templating": "^5.4 || ^6.0 || ^7.0",
"symfony/translation": "^5.4 || ^6.0 || ^7.0",
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
},
"suggest": {
"ext-fileinfo": "Required for MimeType",
Expand Down
5 changes: 1 addition & 4 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@

class Configuration implements ConfigurationInterface
{
protected array $adapterFactories;

public function __construct(array $adapterFactories)
public function __construct(protected array $adapterFactories)
{
$this->adapterFactories = $adapterFactories;
}

public function getConfigTreeBuilder(): TreeBuilder
Expand Down
4 changes: 2 additions & 2 deletions tests/App/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class Kernel extends BaseKernel
public function registerBundles(): iterable
{
return [
new FrameworkBundle(),
yield new FrameworkBundle(),

// Test this Bundle
new OneupFlysystemBundle(),
yield new OneupFlysystemBundle(),
];
}

Expand Down
10 changes: 5 additions & 5 deletions tests/DependencyInjection/Compiler/FilesystemPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

use League\Flysystem\Filesystem;
use League\Flysystem\MountManager;
use Oneup\FlysystemBundle\Tests\Model\ContainerAwareTestCase;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

final class FilesystemPassTest extends ContainerAwareTestCase
final class FilesystemPassTest extends WebTestCase
{
public function testMountIdentifiers(): void
{
/** @var MountManager $mountManager */
$mountManager = $this->getContainer()->get('oneup_flysystem.mount_manager');
$mountManager = self::getContainer()->get('oneup_flysystem.mount_manager');
/** @var Filesystem $filesystem1 */
$filesystem1 = $this->getContainer()->get('oneup_flysystem.myfilesystem_filesystem');
$filesystem1 = self::getContainer()->get('oneup_flysystem.myfilesystem_filesystem');
/** @var Filesystem $filesystem2 */
$filesystem2 = $this->getContainer()->get('oneup_flysystem.myfilesystem2_filesystem');
$filesystem2 = self::getContainer()->get('oneup_flysystem.myfilesystem2_filesystem');

self::assertFalse($filesystem1->fileExists('foo'));
self::assertFalse($filesystem2->fileExists('bar'));
Expand Down
18 changes: 9 additions & 9 deletions tests/DependencyInjection/OneupFlysystemExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
use League\Flysystem\StorageAttributes;
use League\Flysystem\Visibility;
use Oneup\FlysystemBundle\DependencyInjection\OneupFlysystemExtension;
use Oneup\FlysystemBundle\Tests\Model\ContainerAwareTestCase;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class OneupFlysystemExtensionTest extends ContainerAwareTestCase
class OneupFlysystemExtensionTest extends WebTestCase
{
public function testIfTestSuiteLoads(): void
{
Expand All @@ -28,21 +28,21 @@ public function testVisibilitySettings(): void
*
* @var Filesystem $filesystem1
*/
$filesystem1 = $this->getContainer()->get('oneup_flysystem.myfilesystem_filesystem');
$filesystem1 = self::getContainer()->get('oneup_flysystem.myfilesystem_filesystem');

/**
* Visibility flag is set to "public".
*
* @var Filesystem $filesystem2
*/
$filesystem2 = $this->getContainer()->get('oneup_flysystem.myfilesystem2_filesystem');
$filesystem2 = self::getContainer()->get('oneup_flysystem.myfilesystem2_filesystem');

/**
* Visibility flag is set to "private".
*
* @var Filesystem $filesystem3
*/
$filesystem3 = $this->getContainer()->get('oneup_flysystem.myfilesystem3_filesystem');
$filesystem3 = self::getContainer()->get('oneup_flysystem.myfilesystem3_filesystem');

$filesystem1->write('1/meep', 'meep\'s content');
$filesystem2->write('2/meep', 'meep\'s content');
Expand All @@ -68,14 +68,14 @@ public function testDirectoryVisibilitySettings(): void
*
* @var Filesystem $filesystem5
*/
$filesystem5 = $this->getContainer()->get('oneup_flysystem.myfilesystem5_filesystem');
$filesystem5 = self::getContainer()->get('oneup_flysystem.myfilesystem5_filesystem');

/**
* Visibility flag is set to "public".
*
* @var Filesystem $filesystem6
*/
$filesystem6 = $this->getContainer()->get('oneup_flysystem.myfilesystem6_filesystem');
$filesystem6 = self::getContainer()->get('oneup_flysystem.myfilesystem6_filesystem');

$filesystem5->createDirectory('5');
$filesystem6->createDirectory('6');
Expand Down Expand Up @@ -186,15 +186,15 @@ public function testServiceAliasWithoutFilesystemSuffix(): void
public function testServiceAliasInjection(): void
{
/** @var TestService $testService */
$testService = $this->getContainer()->get(TestService::class);
$testService = self::getContainer()->get(TestService::class);

self::assertInstanceOf(TestService::class, $testService);
self::assertInstanceOf(Filesystem::class, $testService->filesystem);
}

public function testGoogleCloudAdapter(): void
{
$this->assertInstanceOf(Filesystem::class, $this->getContainer()->get('oneup_flysystem.myfilesystem4_filesystem'));
$this->assertInstanceOf(Filesystem::class, self::getContainer()->get('oneup_flysystem.myfilesystem4_filesystem'));
}

private function loadExtension(array $config): ContainerBuilder
Expand Down
44 changes: 0 additions & 44 deletions tests/Model/ContainerAwareTestCase.php

This file was deleted.

0 comments on commit 76949b0

Please sign in to comment.