Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 335121e

Browse files
authored
Merge pull request #1644 from liip/php-85
test with php 8.5
2 parents d3d2972 + 3c197bc commit 335121e

12 files changed

Lines changed: 61 additions & 23 deletions

File tree

.github/workflows/phpunit.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
17+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1818
dependencies: [highest]
1919
symfony: ['*']
2020
stability: ['stable']
@@ -26,7 +26,7 @@ jobs:
2626
stability: 'stable'
2727

2828
# Minimum supported dependencies with the latest supported PHP version
29-
- php: '8.4'
29+
- php: '8.5'
3030
dependencies: lowest
3131
symfony: '*'
3232
stability: 'stable'
@@ -42,17 +42,17 @@ jobs:
4242
symfony: '6.4.*'
4343
stability: 'stable'
4444

45-
# Test Symfony 7.4 dev version
46-
- php: '8.4'
45+
# Test Symfony 7.4
46+
- php: '8.5'
4747
dependencies: highest
4848
symfony: '7.4.*'
49-
stability: 'dev'
49+
stability: 'stable'
5050

51-
# Test Symfony 8.0 dev version
52-
- php: '8.4'
51+
# Test Symfony 8.0
52+
- php: '8.5'
5353
dependencies: highest
5454
symfony: '8.0.*'
55-
stability: 'dev'
55+
stability: 'stable'
5656
steps:
5757
- name: Checkout
5858
uses: actions/checkout@v5

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ for a given releases. Unreleased, upcoming changes will be updated here periodic
66

77
# 2.x
88

9-
## 2.16.0 (unreleased)
9+
## [2.16.0](https://github.com/liip/LiipImagineBundle/tree/2.16.0)
1010

11+
- Compatible with Symfony 8 ([dmaicher](https://github.com/liip/LiipImagineBundle/pull/1642)) (including a bunch of PRs to change all XML configuration to PHP configuration)
12+
- Test with PHP 8.5 and fix deprecations([dbu](https://github.com/liip/LiipImagineBundle/pull/1644))
1113
- Drop support for unmaintained Symfony versions ([dmaicher](https://github.com/liip/LiipImagineBundle/pull/1639))
1214

13-
## [2.15.0](https://github.com/liip/LiipImagineBundle/tree/2.14.0)
15+
## [2.15.0](https://github.com/liip/LiipImagineBundle/tree/2.15.0)
1416

1517
- Refactored `Request::get()` to `Request::query::get()` to avoid deprecation with Symfony 7.4 ([dmaicher](https://github.com/liip/LiipImagineBundle/pull/1636))
1618

Imagine/Data/DataManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function getLoader($filter)
105105

106106
$loaderName = empty($config['data_loader']) ? $this->defaultLoader : $config['data_loader'];
107107

108-
if (!isset($this->loaders[$loaderName])) {
108+
if (null === $loaderName || !\array_key_exists($loaderName, $this->loaders)) {
109109
throw new \InvalidArgumentException(\sprintf('Could not find data loader "%s" for "%s" filter type', $loaderName, $filter));
110110
}
111111

Tests/AbstractTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ protected function getVisibilityRestrictedMethod($object, string $name): \Reflec
293293
$r = new \ReflectionObject($object);
294294

295295
$m = $r->getMethod($name);
296-
$m->setAccessible(true);
296+
// remove when we drop support for PHP older than 8.1
297+
if (PHP_VERSION_ID < 80100) {
298+
$m->setAccessible(true);
299+
}
297300

298301
return $m;
299302
}

Tests/Binary/Locator/FileSystemLocatorTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ public function testAllowInvalidPaths(): void
2323
{
2424
$locator = new FileSystemLocator(['/does/not/exist/foo', '/does/not/exist/bar', $temp = sys_get_temp_dir()], true);
2525
$roots = (new \ReflectionObject($locator))->getProperty('roots');
26-
$roots->setAccessible(true);
26+
// remove when we drop support for PHP older than 8.1
27+
if (PHP_VERSION_ID < 80100) {
28+
$roots->setAccessible(true);
29+
}
2730
$array = [
2831
'',
2932
'',

Tests/DependencyInjection/Compiler/MetadataReaderCompilerPassTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ public function testDoesNotOverrideCustomReaderWhenExifNotAvailable(): void
7676
private static function getVisibilityRestrictedStaticProperty(\ReflectionClass $r, string $p): string
7777
{
7878
$property = $r->getProperty($p);
79-
$property->setAccessible(true);
79+
// remove when we drop support for PHP older than 8.1
80+
if (PHP_VERSION_ID < 80100) {
81+
$property->setAccessible(true);
82+
}
8083

8184
return $property->getValue();
8285
}

Tests/Functional/AbstractWebTestCase.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ protected function getPrivateProperty($object, string $name)
5252
$r = new \ReflectionObject($object);
5353

5454
$p = $r->getProperty($name);
55-
$p->setAccessible(true);
55+
// remove when we drop support for PHP older than 8.1
56+
if (PHP_VERSION_ID < 80100) {
57+
$p->setAccessible(true);
58+
}
5659

5760
return $p->getValue($object);
5861
}

Tests/Functional/Controller/ImagineControllerTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ protected function setUp(): void
4141
if ($this->webp_generate) {
4242
$filterService = $this->getService('test.liip_imagine.service.filter');
4343
$webpGenerate = new \ReflectionProperty($filterService, 'webpGenerate');
44-
$webpGenerate->setAccessible(true);
44+
// remove when we drop support for PHP older than 8.1
45+
if (PHP_VERSION_ID < 80100) {
46+
$webpGenerate->setAccessible(true);
47+
}
4548
$webpGenerate->setValue($filterService, true);
4649
}
4750
}

Tests/Imagine/Cache/Resolver/WebPathResolverTest.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,10 @@ public function testShouldRemoveDoubleSlashInUrl(): void
462462

463463
$rc = new \ReflectionClass($resolver);
464464
$method = $rc->getMethod('getFileUrl');
465-
$method->setAccessible(true);
465+
// remove when we drop support for PHP older than 8.1
466+
if (PHP_VERSION_ID < 80100) {
467+
$method->setAccessible(true);
468+
}
466469

467470
$result = $method->invokeArgs($resolver, ['/cats.jpg', 'some_filter']);
468471

@@ -480,7 +483,10 @@ public function testShouldSanitizeSeparatorBetweenSchemeAndAuthorityInUrl(): voi
480483

481484
$rc = new \ReflectionClass($resolver);
482485
$method = $rc->getMethod('getFileUrl');
483-
$method->setAccessible(true);
486+
// remove when we drop support for PHP older than 8.1
487+
if (PHP_VERSION_ID < 80100) {
488+
$method->setAccessible(true);
489+
}
484490

485491
$result = $method->invokeArgs($resolver, ['https://some.meme.com/cute/cats.jpg', 'some_filter']);
486492

@@ -494,9 +500,15 @@ public static function assertAttributeSame($expected, string $actualAttributeNam
494500
{
495501
$reflector = new \ReflectionObject($actualClassOrObject);
496502
$attribute = $reflector->getProperty($actualAttributeName);
497-
$attribute->setAccessible(true);
503+
// remove when we drop support for PHP older than 8.1
504+
if (PHP_VERSION_ID < 80100) {
505+
$attribute->setAccessible(true);
506+
}
498507
$actual = $attribute->getValue($actualClassOrObject);
499-
$attribute->setAccessible(false);
508+
// remove when we drop support for PHP older than 8.1
509+
if (PHP_VERSION_ID < 80100) {
510+
$attribute->setAccessible(false);
511+
}
500512

501513
self::assertSame($expected, $actual, $message);
502514
}

Tests/Imagine/Data/DataManagerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Liip\ImagineBundle\Tests\Imagine\Data;
1313

14+
use Liip\ImagineBundle\Exception\InvalidArgumentException;
1415
use Liip\ImagineBundle\Imagine\Data\DataManager;
1516
use Liip\ImagineBundle\Model\Binary;
1617
use Liip\ImagineBundle\Tests\AbstractTest;
@@ -23,7 +24,7 @@ class DataManagerTest extends AbstractTest
2324
{
2425
public function testThrowsIfConstructedWithWrongTypeArguments(): void
2526
{
26-
$this->expectException(\Liip\ImagineBundle\Exception\InvalidArgumentException::class);
27+
$this->expectException(InvalidArgumentException::class);
2728
$this->expectExceptionMessage('$extensionGuesser must be an instance of Symfony\Component\Mime\MimeTypesInterface or Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesserInterface');
2829

2930
$mimeTypeGuesser = $this->createMimeTypeGuesserInterfaceMock();

0 commit comments

Comments
 (0)