Skip to content

Commit 829ca6b

Browse files
Merge branch '4.4' into 5.1
* 4.4: [DI] Fix Preloader exception when preloading a class with an unknown parent/interface [Translation] added missing Albanian translations [Form, Security, Validator] Add missing Turkish translations (tr) Display php info for extra versions in travis [ProxyManager] use "composer/package-versions-deprecated" instead of "ocramius/package-versions" 38737 add missing dutch translation Fix transient tests [Validator] Add missing Slovak translations. [Form, Security, Validator] Add missing Persian translations (fa_IR) [Form] Fix wrong translations for Ukrainian (uk) [Validator] Add missing translations for Ukrainian (uk) [Security] Add missing translations for Ukrainian (uk) [Form] Add missing translations for Ukrainian (uk) [Security] Add missing Slovak translations. [Form] Added missing Spanish translations. Fix transient tests
2 parents fe00d94 + 4c41ad6 commit 829ca6b

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

Dumper/Preloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static function doPreload(string $class, array &$preloaded): void
106106

107107
self::preloadType($m->getReturnType(), $preloaded);
108108
}
109-
} catch (\ReflectionException $e) {
109+
} catch (\Throwable $e) {
110110
// ignore missing classes
111111
}
112112
}

Tests/Dumper/PreloaderTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ public function testPreload()
3434
self::assertTrue(class_exists('Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\C', false));
3535
}
3636

37+
/**
38+
* @requires PHP 7.4
39+
*/
40+
public function testPreloadSkipsNonExistingInterface()
41+
{
42+
$r = new \ReflectionMethod(Preloader::class, 'doPreload');
43+
$r->setAccessible(true);
44+
45+
$preloaded = [];
46+
47+
$r->invokeArgs(null, ['Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\DummyWithInterface', &$preloaded]);
48+
self::assertFalse(class_exists('Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\DummyWithInterface', false));
49+
}
50+
3751
/**
3852
* @requires PHP 8
3953
*/
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Preload;
13+
14+
final class DummyWithInterface implements \NonExistentDummyInterface
15+
{
16+
}

0 commit comments

Comments
 (0)