Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Symfony 7 #1535

Merged
merged 1 commit into from
Nov 14, 2023
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
24 changes: 12 additions & 12 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
stability: 'stable'

# Minimum supported dependencies with the latest supported PHP version
- php: '8.0'
- php: '8.2'
dependencies: lowest
symfony: '*'
stability: 'stable'
Expand All @@ -47,20 +47,20 @@ jobs:
symfony: '5.3.*'
stability: 'stable'

# Test Symfony 5.4 dev version
- php: '7.4'
# Test Symfony 6.4 dev version
- php: '8.2'
dependencies: highest
symfony: '5.4.*'
symfony: '6.4.*'
stability: 'dev'

# Test Symfony 6.0 dev version
- php: '8.0'
# Test Symfony 7.0 dev version
- php: '8.2'
dependencies: highest
symfony: '6.0.*'
symfony: '7.0.*'
stability: 'dev'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure coverage driver
id: coverage
Expand All @@ -77,13 +77,13 @@ jobs:
if: matrix.symfony != '*'
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-interaction --no-progress symfony/flex:^1.11
composer global require --no-interaction --no-progress symfony/flex
composer config extra.symfony.require ${{ matrix.symfony }}

- name: Remove non-compatible dependencies with Symfony 6
if: matrix.symfony == '6.0.*'
- name: Remove non-compatible dependencies with Symfony 7
if: matrix.symfony == '7.0.*'
run: |
composer remove enqueue/enqueue-bundle --dev --no-update
composer remove enqueue/enqueue-bundle symfony/templating --dev --no-update

- name: Set minimum-stability
run: composer config minimum-stability ${{ matrix.stability }}
Expand Down
3 changes: 1 addition & 2 deletions Message/Handler/WarmupCacheHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
use Liip\ImagineBundle\Imagine\Filter\FilterManager;
use Liip\ImagineBundle\Message\WarmupCache;
use Liip\ImagineBundle\Service\FilterService;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

/**
* Listen to WarmupCache messages and prepare the cache for those images.
*
* @experimental
*/
class WarmupCacheHandler implements MessageHandlerInterface
class WarmupCacheHandler
Comment on lines -24 to +23
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface is removed in favor of the AsMessageHandler attribute for autowiring, but since the service isn't autowired, the attribute isn't really necessary here.

{
/** @var FilterManager */
private $filterManager;
Expand Down
2 changes: 0 additions & 2 deletions Tests/Binary/Loader/FlysystemLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
use Symfony\Component\Mime\MimeTypes;

/**
* @requires PHP 5.4
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package requires PHP 7.2, so this is unnecessary

*
* @covers \Liip\ImagineBundle\Binary\Loader\FlysystemLoader
*/
class FlysystemLoaderTest extends AbstractTest
Expand Down
2 changes: 0 additions & 2 deletions Tests/Binary/Loader/FlysystemV2LoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
use Symfony\Component\Mime\MimeTypes;

/**
* @requires PHP 7.2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package requires PHP 7.2, so this is unnecessary

*
* @covers \Liip\ImagineBundle\Binary\Loader\FlysystemV2Loader
*/
class FlysystemV2LoaderTest extends AbstractTest
Expand Down
2 changes: 0 additions & 2 deletions Tests/Imagine/Cache/Resolver/FlysystemV2ResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
use Symfony\Component\Routing\RequestContext;

/**
* @requires PHP 7.2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package requires PHP 7.2, so this is unnecessary

*
* @covers \Liip\ImagineBundle\Imagine\Cache\Resolver\FlysystemV2Resolver
*/
class FlysystemV2ResolverTest extends AbstractTest
Expand Down
10 changes: 0 additions & 10 deletions Tests/Message/Handler/WarmupCacheHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@
use Liip\ImagineBundle\Message\WarmupCache;
use Liip\ImagineBundle\Service\FilterService;
use Liip\ImagineBundle\Tests\Functional\AbstractWebTestCase;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
use Symfony\Component\Messenger\MessageBusInterface;

/**
* @requires PHP 7.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package requires PHP 7.2, so this is unnecessary

*
* @covers \Liip\ImagineBundle\Message\Handler\WarmupCacheHandler
*/
class WarmupCacheHandlerTest extends AbstractWebTestCase
Expand All @@ -36,13 +33,6 @@ protected function setUp(): void
}
}

public function testShouldImplementMessageHandlerInterface(): void
{
$rc = new \ReflectionClass(WarmupCacheHandler::class);

$this->assertTrue($rc->implementsInterface(MessageHandlerInterface::class));
}

Comment on lines -39 to -45
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the interface is removed from the framework, and the class no longer implements it, the test is unnecessary.

public function testCouldBeConstructedWithExpectedArguments(): void
{
static::createClient();
Expand Down
8 changes: 8 additions & 0 deletions Tests/Templating/AbstractFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@
use Liip\ImagineBundle\Templating\FilterExtension;
use Liip\ImagineBundle\Templating\Helper\FilterHelper;
use Liip\ImagineBundle\Tests\AbstractTest;
use Symfony\Component\Templating\Helper\Helper;

abstract class AbstractFilterTest extends AbstractTest
{
public static function setUpBeforeClass(): void
{
if (!class_exists(Helper::class)) {
static::markTestSkipped('Test requires deprecated symfony/templating component');
}
}
Comment on lines +22 to +27
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symfony/templating is deprecated and removed from the framework in 7.0. So, this can't be tested when working with versions of the framework without the component are installed.


public function testCanBeConstructed(): void
{
$this->createTemplatingMock();
Expand Down
34 changes: 17 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "symfony-bundle",
"description": "This bundle provides an image manipulation abstraction toolkit for Symfony-based projects.",
"keywords": [ "imagine", "image", "manipulation", "pictures", "photos", "transformation", "bundle", "symfony", "liip" ],
"homepage": "http://liip.ch",
"homepage": "https://www.liip.ch",
"license": "MIT",
"authors": [
{
Expand All @@ -21,35 +21,35 @@
"php": "^7.2|^8.0",
"ext-mbstring": "*",
"imagine/imagine": "^1.3.2",
"symfony/filesystem": "^3.4|^4.4|^5.3|^6.0",
"symfony/finder": "^3.4|^4.4|^5.3|^6.0",
"symfony/framework-bundle": "^3.4.23|^4.4|^5.3|^6.0",
"symfony/mime": "^4.4|^5.3|^6.0",
"symfony/options-resolver": "^3.4|^4.4|^5.3|^6.0",
"symfony/process": "^3.4|^4.4|^5.3|^6.0",
"symfony/filesystem": "^3.4|^4.4|^5.3|^6.0|^7.0",
"symfony/finder": "^3.4|^4.4|^5.3|^6.0|^7.0",
"symfony/framework-bundle": "^3.4.23|^4.4|^5.3|^6.0|^7.0",
"symfony/mime": "^4.4|^5.3|^6.0|^7.0",
"symfony/options-resolver": "^3.4|^4.4|^5.3|^6.0|^7.0",
"symfony/process": "^3.4|^4.4|^5.3|^6.0|^7.0",
"twig/twig": "^1.44|^2.9|^3.0"
},
"require-dev": {
"ext-gd": "*",
"amazonwebservices/aws-sdk-for-php": "^1.0",
"aws/aws-sdk-php": "^2.4",
"aws/aws-sdk-php": "^2.4|^3.0",
"doctrine/cache": "^1.11|^2.0",
"doctrine/persistence": "^1.3|^2.0",
"enqueue/enqueue-bundle": "^0.9|^0.10",
"league/flysystem": "^1.0|^2.0|^3.0",
"phpstan/phpstan": "^1.10.0",
"psr/cache": "^1.0|^2.0|^3.0",
"psr/log": "^1.0",
"symfony/browser-kit": "^3.4|^4.4|^5.3|^6.0",
"symfony/cache": "^3.4|^4.4|^5.3|^6.0",
"symfony/console": "^3.4|^4.4|^5.3|^6.0",
"symfony/dependency-injection": "^3.4|^4.4|^5.3|^6.0",
"symfony/form": "^3.4|^4.4|^5.3|^6.0",
"symfony/messenger": "^4.4|^5.3|^6.0",
"symfony/phpunit-bridge": "^5.3",
"symfony/browser-kit": "^3.4|^4.4|^5.3|^6.0|^7.0",
"symfony/cache": "^3.4|^4.4|^5.3|^6.0|^7.0",
"symfony/console": "^3.4|^4.4|^5.3|^6.0|^7.0",
"symfony/dependency-injection": "^3.4|^4.4|^5.3|^6.0|^7.0",
"symfony/form": "^3.4|^4.4|^5.3|^6.0|^7.0",
"symfony/messenger": "^4.4|^5.3|^6.0|^7.0",
"symfony/phpunit-bridge": "^5.3|^6.0|^7.0",
"symfony/templating": "^3.4|^4.4|^5.3|^6.0",
"symfony/validator": "^3.4|^4.4|^5.3|^6.0",
"symfony/yaml": "^3.4|^4.4|^5.3|^6.0"
"symfony/validator": "^3.4|^4.4|^5.3|^6.0|^7.0",
"symfony/yaml": "^3.4|^4.4|^5.3|^6.0|^7.0"
},
"suggest": {
"ext-exif": "required to read EXIF metadata from images",
Expand Down