From f4cc977d6c98e77d7ae6969bbf0b12101866c1bc Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Tue, 2 Jan 2024 16:39:34 +0100 Subject: [PATCH] fix cs --- .github/workflows/phpunit.yml | 2 +- CHANGELOG.md | 2 ++ Imagine/Filter/Loader/PasteFilterLoader.php | 2 +- .../Filter/Loader/WatermarkFilterLoader.php | 2 +- .../Controller/ImagineControllerTest.php | 18 ++++++++++-------- composer.json | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 5f22a2e58..20005486e 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -31,7 +31,7 @@ jobs: symfony: '*' stability: 'stable' - # Test each supported Symfony version with lowest supported PHP version + # Test each supported Symfony version with the lowest supported PHP version - php: '7.2' dependencies: highest symfony: '3.4.*' diff --git a/CHANGELOG.md b/CHANGELOG.md index 75992ec9c..e633af86b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file contains a complete enumeration of all [pull requests](https://github. for a given releases. Unreleased, upcoming changes will be updated here periodically; reference the next release on our [milestones](https://github.com/liip/LiipImagineBundle/milestones) page for the latest changes. +# 2.x + ## [2.12.1](https://github.com/liip/LiipImagineBundle/tree/2.12.1) - Adjustments to install with Symfony 7 ([mbabker](https://github.com/liip/LiipImagineBundle/pull/1535)) diff --git a/Imagine/Filter/Loader/PasteFilterLoader.php b/Imagine/Filter/Loader/PasteFilterLoader.php index c2427290a..8435d8f99 100644 --- a/Imagine/Filter/Loader/PasteFilterLoader.php +++ b/Imagine/Filter/Loader/PasteFilterLoader.php @@ -34,7 +34,7 @@ public function __construct(ImagineInterface $imagine, $projectDir) } /** - * @see \Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface::load() + * @see LoaderInterface::load * * @return ImageInterface|static */ diff --git a/Imagine/Filter/Loader/WatermarkFilterLoader.php b/Imagine/Filter/Loader/WatermarkFilterLoader.php index 1d55dfc6e..16ded2fa7 100644 --- a/Imagine/Filter/Loader/WatermarkFilterLoader.php +++ b/Imagine/Filter/Loader/WatermarkFilterLoader.php @@ -35,7 +35,7 @@ public function __construct(ImagineInterface $imagine, $projectDir) } /** - * @see \Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface::load() + * @see LoaderInterface::load * * @return ImageInterface|static */ diff --git a/Tests/Functional/Controller/ImagineControllerTest.php b/Tests/Functional/Controller/ImagineControllerTest.php index 1f7ae13da..bb08d6714 100644 --- a/Tests/Functional/Controller/ImagineControllerTest.php +++ b/Tests/Functional/Controller/ImagineControllerTest.php @@ -15,6 +15,8 @@ use Liip\ImagineBundle\Imagine\Cache\Signer; use Liip\ImagineBundle\Tests\Functional\AbstractSetupWebTestCase; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * @covers \Liip\ImagineBundle\Controller\ImagineController @@ -37,7 +39,7 @@ protected function setUp(): void // supported by the current PHP build or not. Enabling WebP in configurations will drop all tests if WebP is // not supported. if ($this->webp_generate) { - $filterService = self::getService('test.liip_imagine.service.filter'); + $filterService = $this->getService('test.liip_imagine.service.filter'); $webpGenerate = new \ReflectionProperty($filterService, 'webpGenerate'); $webpGenerate->setAccessible(true); $webpGenerate->setValue($filterService, true); @@ -162,7 +164,7 @@ public function testShouldResolveWebPFromCache(): void public function testThrowBadRequestIfSignInvalidWhileUsingCustomFilters(): void { - $this->expectException(\Symfony\Component\HttpKernel\Exception\BadRequestHttpException::class); + $this->expectException(BadRequestHttpException::class); $this->expectExceptionMessage('Signed url does not pass the sign check for path "images/cats.jpeg" and filter "thumbnail_web_path" and runtime config {"thumbnail":{"size":["50","50"]}}'); $this->client->request('GET', '/media/cache/resolve/thumbnail_web_path/rc/invalidHash/images/cats.jpeg?'.http_build_query([ @@ -175,7 +177,7 @@ public function testThrowBadRequestIfSignInvalidWhileUsingCustomFilters(): void public function testShouldThrowNotFoundHttpExceptionIfFiltersNotArray(): void { - $this->expectException(\Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class); + $this->expectException(NotFoundHttpException::class); $this->expectExceptionMessage('Filters must be an array. Value was "some-string"'); $this->client->request('GET', '/media/cache/resolve/thumbnail_web_path/rc/invalidHash/images/cats.jpeg?'.http_build_query([ @@ -186,7 +188,7 @@ public function testShouldThrowNotFoundHttpExceptionIfFiltersNotArray(): void public function testShouldThrowNotFoundHttpExceptionIfFileNotExists(): void { - $this->expectException(\Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class); + $this->expectException(NotFoundHttpException::class); $this->expectExceptionMessage('Source image for path "images/shrodinger_cats_which_not_exist.jpeg" could not be found'); $this->client->request('GET', '/media/cache/resolve/thumbnail_web_path/images/shrodinger_cats_which_not_exist.jpeg'); @@ -194,7 +196,7 @@ public function testShouldThrowNotFoundHttpExceptionIfFileNotExists(): void public function testInvalidFilterShouldThrowNotFoundHttpException(): void { - $this->expectException(\Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class); + $this->expectException(NotFoundHttpException::class); $this->client->request('GET', '/media/cache/resolve/invalid-filter/images/cats.jpeg'); } @@ -202,7 +204,7 @@ public function testInvalidFilterShouldThrowNotFoundHttpException(): void public function testShouldResolveWithCustomFiltersPopulatingCacheFirst(): void { /** @var Signer $signer */ - $signer = self::getService('liip_imagine.cache.signer'); + $signer = $this->getService('liip_imagine.cache.signer'); $params = [ 'filters' => [ @@ -240,7 +242,7 @@ public function testShouldResolveWithCustomFiltersPopulatingCacheFirst(): void public function testShouldResolveWithCustomFiltersPopulatingCacheFirstWebP(): void { /** @var Signer $signer */ - $signer = self::getService('liip_imagine.cache.signer'); + $signer = $this->getService('liip_imagine.cache.signer'); $params = [ 'filters' => [ @@ -283,7 +285,7 @@ public function testShouldResolveWithCustomFiltersPopulatingCacheFirstWebP(): vo public function testShouldResolveWithCustomFiltersFromCache(): void { /** @var Signer $signer */ - $signer = self::getService('liip_imagine.cache.signer'); + $signer = $this->getService('liip_imagine.cache.signer'); $params = [ 'filters' => [ diff --git a/composer.json b/composer.json index e5f2c9954..69758404e 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "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/phpunit-bridge": "^6.4|^7.0", "symfony/templating": "^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"