Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ca56620

Browse filesBrowse files
Fix deprecations on PHP 8.2
1 parent 75bf7fa commit ca56620
Copy full SHA for ca56620

File tree

Expand file treeCollapse file tree

23 files changed

+204
-77
lines changed
Filter options
Expand file treeCollapse file tree

23 files changed

+204
-77
lines changed

‎.github/workflows/unit-tests.yml

Copy file name to clipboardExpand all lines: .github/workflows/unit-tests.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- php: '8.1'
2727
mode: low-deps
2828
- php: '8.2'
29-
mode: experimental
29+
#mode: experimental
3030
fail-fast: false
3131

3232
runs-on: ubuntu-20.04

‎src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
use Doctrine\Common\Collections\ArrayCollection;
1515
use Doctrine\DBAL\Types\Type;
16+
use Doctrine\ORM\Mapping\ClassMetadataInfo;
1617
use Doctrine\ORM\Tools\SchemaTool;
1718
use Doctrine\Persistence\ManagerRegistry;
18-
use Doctrine\Persistence\Mapping\ClassMetadata;
1919
use Doctrine\Persistence\ObjectManager;
2020
use Doctrine\Persistence\ObjectRepository;
2121
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
@@ -111,7 +111,7 @@ protected function createEntityManagerMock($repositoryMock)
111111
->willReturn($repositoryMock)
112112
;
113113

114-
$classMetadata = $this->createMock(ClassMetadata::class);
114+
$classMetadata = $this->createMock(ClassMetadataInfo::class);
115115
$classMetadata
116116
->expects($this->any())
117117
->method('hasField')

‎src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ function ($definition) {
194194
}
195195
}
196196

197+
#[\AllowDynamicProperties]
197198
final class DummyClass implements DummyInterface, SunnyInterface
198199
{
199200
private $ref;

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddAnnotationsCachedReaderPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddAnnotationsCachedReaderPass.php
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
1313

14+
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
1415
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1516
use Symfony\Component\DependencyInjection\ContainerBuilder;
1617

@@ -28,14 +29,18 @@ public function process(ContainerBuilder $container)
2829
// "annotation_reader" at build time don't get any cache
2930
foreach ($container->findTaggedServiceIds('annotations.cached_reader') as $id => $tags) {
3031
$reader = $container->getDefinition($id);
32+
$reader->setPublic(false);
3133
$properties = $reader->getProperties();
3234

3335
if (isset($properties['cacheProviderBackup'])) {
3436
$provider = $properties['cacheProviderBackup']->getValues()[0];
3537
unset($properties['cacheProviderBackup']);
3638
$reader->setProperties($properties);
37-
$container->set($id, null);
38-
$container->setDefinition($id, $reader->replaceArgument(1, $provider));
39+
$reader->replaceArgument(1, $provider);
40+
} elseif (4 <= \count($arguments = $reader->getArguments()) && $arguments[3] instanceof ServiceClosureArgument) {
41+
$arguments[1] = $arguments[3]->getValues()[0];
42+
unset($arguments[3]);
43+
$reader->setArguments($arguments);
3944
}
4045
}
4146
}

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,9 +1463,10 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
14631463

14641464
$container
14651465
->getDefinition('annotations.cached_reader')
1466+
->setPublic(true) // set to false in AddAnnotationsCachedReaderPass
14661467
->replaceArgument(2, $config['debug'])
1467-
// temporary property to lazy-reference the cache provider without using it until AddAnnotationsCachedReaderPass runs
1468-
->setProperty('cacheProviderBackup', new ServiceClosureArgument(new Reference($cacheService)))
1468+
// reference the cache provider without using it until AddAnnotationsCachedReaderPass runs
1469+
->addArgument(new ServiceClosureArgument(new Reference($cacheService)))
14691470
->addTag('annotations.cached_reader')
14701471
;
14711472

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public static function configureStatic1()
5656

5757
class BarUserClass
5858
{
59+
public $foo;
5960
public $bar;
6061

6162
public function __construct(BarClass $bar)

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
class FooClass
66
{
7+
public $qux;
78
public $foo;
89
public $moo;
910

‎src/Symfony/Component/DomCrawler/Crawler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Crawler.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,11 +1214,11 @@ private function convertToHtmlEntities(string $htmlContent, string $charset = 'U
12141214
set_error_handler(function () { throw new \Exception(); });
12151215

12161216
try {
1217-
return mb_convert_encoding($htmlContent, 'HTML-ENTITIES', $charset);
1217+
return mb_encode_numericentity($htmlContent, [0x80, 0xFFFF, 0, 0xFFFF], $charset);
12181218
} catch (\Exception|\ValueError $e) {
12191219
try {
12201220
$htmlContent = iconv($charset, 'UTF-8', $htmlContent);
1221-
$htmlContent = mb_convert_encoding($htmlContent, 'HTML-ENTITIES', 'UTF-8');
1221+
$htmlContent = mb_encode_numericentity($htmlContent, [0x80, 0xFFFF, 0, 0xFFFF], 'UTF-8');
12221222
} catch (\Exception|\ValueError $e) {
12231223
}
12241224

‎src/Symfony/Component/Filesystem/Tests/Fixtures/MockStream/MockStream.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Filesystem/Tests/Fixtures/MockStream/MockStream.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818
class MockStream
1919
{
20+
public $context;
21+
2022
/**
2123
* Opens file or URL.
2224
*

‎src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectDummy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectDummy.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Symfony\Component\Serializer\Tests\Normalizer\Features;
44

5+
#[\AllowDynamicProperties]
56
class ObjectDummy
67
{
78
protected $foo;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.