Skip to content

Commit

Permalink
Merge branch '4.4' into 5.1
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nicolas-grekas committed Oct 27, 2020
2 parents fe00d94 + 4c41ad6 commit 829ca6b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dumper/Preloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private static function doPreload(string $class, array &$preloaded): void

self::preloadType($m->getReturnType(), $preloaded);
}
} catch (\ReflectionException $e) {
} catch (\Throwable $e) {
// ignore missing classes
}
}
Expand Down
14 changes: 14 additions & 0 deletions Tests/Dumper/PreloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ public function testPreload()
self::assertTrue(class_exists('Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\C', false));
}

/**
* @requires PHP 7.4
*/
public function testPreloadSkipsNonExistingInterface()
{
$r = new \ReflectionMethod(Preloader::class, 'doPreload');
$r->setAccessible(true);

$preloaded = [];

$r->invokeArgs(null, ['Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\DummyWithInterface', &$preloaded]);
self::assertFalse(class_exists('Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\DummyWithInterface', false));
}

/**
* @requires PHP 8
*/
Expand Down
16 changes: 16 additions & 0 deletions Tests/Fixtures/Preload/DummyWithInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Preload;

final class DummyWithInterface implements \NonExistentDummyInterface
{
}

0 comments on commit 829ca6b

Please sign in to comment.