Skip to content

Commit 029c36d

Browse files
committed
Remove some indirect deprecations
1 parent fc2b792 commit 029c36d

File tree

19 files changed

+149
-32
lines changed

19 files changed

+149
-32
lines changed

src/Chartjs/tests/Kernel/TwigAppKernel.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ public function registerBundles(): iterable
3434
public function registerContainerConfiguration(LoaderInterface $loader): void
3535
{
3636
$loader->load(function (ContainerBuilder $container) {
37-
$container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]);
37+
$container->loadFromExtension('framework', [
38+
'secret' => '$ecret',
39+
'test' => true,
40+
'http_method_override' => false,
41+
'php_errors' => [
42+
'log' => true,
43+
],
44+
...(self::VERSION_ID >= 60200 ? [
45+
'handle_all_throwables' => true,
46+
] : []),
47+
]);
3848
$container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]);
3949

4050
$container->setAlias('test.chartjs.builder', 'chartjs.builder')->setPublic(true);

src/Cropperjs/tests/Kernel/FrameworkAppKernel.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
4242
'validation' => [
4343
'email_validation_mode' => 'html5',
4444
],
45+
...(self::VERSION_ID >= 60200 ? [
46+
'handle_all_throwables' => true,
47+
] : []),
4548
];
4649

47-
if (self::VERSION_ID >= 60200) {
48-
$frameworkConfig['handle_all_throwables'] = true;
49-
}
50-
5150
$container->loadFromExtension('framework', $frameworkConfig);
5251
});
5352
}

src/Cropperjs/tests/Kernel/TwigAppKernel.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
4545
'validation' => [
4646
'email_validation_mode' => 'html5',
4747
],
48+
...(self::VERSION_ID >= 60200 ? [
49+
'handle_all_throwables' => true,
50+
] : []),
4851
];
4952

50-
if (self::VERSION_ID >= 60200) {
51-
$frameworkConfig['handle_all_throwables'] = true;
52-
}
53-
5453
$container->loadFromExtension('framework', $frameworkConfig);
5554
$container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]);
5655

src/Dropzone/tests/Kernel/FrameworkAppKernel.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ public function registerBundles(): iterable
3434
public function registerContainerConfiguration(LoaderInterface $loader): void
3535
{
3636
$loader->load(function (ContainerBuilder $container) {
37-
$container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true]);
37+
$container->loadFromExtension('framework', [
38+
'secret' => '$ecret',
39+
'test' => true,
40+
...(self::VERSION_ID >= 70300 ? [
41+
'property_info' => ['with_constructor_extractor' => false],
42+
] : []),
43+
]);
3844
});
3945
}
4046
}

src/Dropzone/tests/Kernel/TwigAppKernel.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@ public function registerBundles(): iterable
3737
public function registerContainerConfiguration(LoaderInterface $loader): void
3838
{
3939
$loader->load(function (ContainerBuilder $container) {
40-
$container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]);
40+
$container->loadFromExtension('framework', [
41+
'secret' => '$ecret',
42+
'test' => true,
43+
'http_method_override' => false,
44+
'php_errors' => [
45+
'log' => true,
46+
],
47+
...(self::VERSION_ID >= 60200 ? [
48+
'handle_all_throwables' => true,
49+
] : []),
50+
]);
4151
$container->loadFromExtension('twig', [
4252
'default_path' => __DIR__.'/templates',
4353
'strict_variables' => true,

src/Icons/tests/Fixtures/TestKernel.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ protected function configureContainer(ContainerConfigurator $container): void
4646
'php_errors' => ['log' => true],
4747
'property_access' => true,
4848
'http_client' => true,
49-
'handle_all_throwables' => true,
49+
...(self::VERSION_ID >= 60200 ? [
50+
'handle_all_throwables' => true,
51+
] : []),
52+
...(self::VERSION_ID >= 70300 ? [
53+
'property_info' => ['with_constructor_extractor' => false],
54+
] : []),
5055
]);
5156

5257
$container->extension('twig', [

src/LazyImage/tests/Kernel/TwigAppKernel.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ public function registerBundles(): iterable
3535
public function registerContainerConfiguration(LoaderInterface $loader): void
3636
{
3737
$loader->load(function (ContainerBuilder $container) {
38-
$container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]);
38+
$container->loadFromExtension('framework', [
39+
'secret' => '$ecret',
40+
'test' => true,
41+
'http_method_override' => false,
42+
'php_errors' => [
43+
'log' => true,
44+
],
45+
...(self::VERSION_ID >= 60200 ? [
46+
'handle_all_throwables' => true,
47+
] : []),
48+
]);
3949
$container->loadFromExtension('twig', ['default_path' => __DIR__.'/templates', 'strict_variables' => true, 'exception_controller' => null]);
4050

4151
$container->setAlias('test.lazy_image.blur_hash', 'lazy_image.blur_hash')->setPublic(true);

src/LiveComponent/tests/Fixtures/Kernel.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,15 @@ protected function configureContainer(ContainerConfigurator $c): void
103103
'validation' => [
104104
'email_validation_mode' => 'html5',
105105
],
106+
...(self::VERSION_ID >= 60200 ? [
107+
'handle_all_throwables' => true,
108+
] : []),
109+
...(self::VERSION_ID >= 70300 ? [
110+
'property_info' => ['with_constructor_extractor' => false],
111+
] : []),
106112
];
107113

108114
if (self::VERSION_ID >= 60400) {
109-
$frameworkConfig['handle_all_throwables'] = true;
110115
$frameworkConfig['session'] = [
111116
'storage_factory_id' => 'session.storage.factory.mock_file',
112117
'cookie_secure' => 'auto',
@@ -143,7 +148,14 @@ protected function configureContainer(ContainerConfigurator $c): void
143148
'anonymous_template_directory' => 'components/',
144149
]);
145150

146-
$c->extension('zenstruck_foundry', []);
151+
$foundryConfig = [];
152+
if (null !== $doctrineBundleVersion = InstalledVersions::getVersion('zenstruck/foundry')) {
153+
if (version_compare($doctrineBundleVersion, '2.5.0', '>=')) {
154+
$doctrineConfig['persistence']['flush_once'] = true;
155+
}
156+
}
157+
158+
$c->extension('zenstruck_foundry', $foundryConfig);
147159

148160
$doctrineConfig = [
149161
'dbal' => [

src/Map/src/Test/RendererTestCase.php

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

1414
use PHPUnit\Framework\Attributes\DataProvider;
1515
use PHPUnit\Framework\TestCase;
16+
use Spatie\Snapshots\Drivers\TextDriver;
1617
use Spatie\Snapshots\MatchesSnapshots;
1718
use Symfony\UX\Map\Elements;
1819
use Symfony\UX\Map\Map;
@@ -40,7 +41,7 @@ public function testRenderMap(RendererInterface $renderer, Map $map, array $attr
4041
$rendered = $this->prettify($rendered);
4142

4243
$this->assertElementsHaveComputedId($rendered);
43-
$this->assertMatchesSnapshot($rendered);
44+
$this->assertMatchesSnapshot($rendered, new TextDriver());
4445
}
4546

4647
private function prettify(string $html): string

src/Map/tests/Kernel/FrameworkAppKernel.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ public function registerBundles(): iterable
3535
public function registerContainerConfiguration(LoaderInterface $loader): void
3636
{
3737
$loader->load(function (ContainerBuilder $container) {
38-
$container->loadFromExtension('framework', ['secret' => '$ecret', 'test' => true, 'http_method_override' => false]);
38+
$container->loadFromExtension('framework', [
39+
'secret' => '$ecret',
40+
'test' => true,
41+
'http_method_override' => false,
42+
...(self::VERSION_ID >= 70300 ? [
43+
'property_info' => ['with_constructor_extractor' => false],
44+
] : []),
45+
]);
3946
$container->loadFromExtension('ux_map', []);
4047

4148
$container->setAlias('test.ux_map.renderers', 'ux_map.renderers')->setPublic(true);

0 commit comments

Comments
 (0)