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 5ed5dcf

Browse filesBrowse files
Merge branch '4.0'
* 4.0: SCA with Php Inspections (EA Extended) Add test case for #25264 Fixed the null value exception case. Remove rc/beta suffix from composer.json files Ensure services & aliases can be referred to with `__toString`able objects Throw an exception is expression language is not installed [DI] Cast ids to string, as done on 3.4 Fail as early and noisily as possible [Console][DI] Fail gracefully [FrameworkBundle] Fix visibility of a test helper [link] clear the cache after linking [DI] Trigger deprecation when setting a to-be-private synthetic service [Intl] Correct Typehint [link] Prevent warnings when running link with 2.7 [Validator] ExpressionValidator should use OBJECT_TO_STRING to allow value in message do not eagerly filter comment lines [WebProfilerBundle], [TwigBundle] Fix Profiler breaking XHTML pages (Content-Type: application/xhtml+xml)
2 parents 8e7eac6 + 1da8591 commit 5ed5dcf
Copy full SHA for 5ed5dcf

File tree

33 files changed

+241
-71
lines changed
Filter options

33 files changed

+241
-71
lines changed

‎link

Copy file name to clipboardExpand all lines: link
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ if (!is_dir("$argv[1]/vendor/symfony")) {
3535
}
3636

3737
$sfPackages = array('symfony/symfony' => __DIR__);
38+
39+
$filesystem = new Filesystem();
3840
foreach (glob(__DIR__.'/src/Symfony/{Bundle,Bridge,Component,Component/Security}/*', GLOB_BRACE | GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
39-
$sfPackages[json_decode(file_get_contents("$dir/composer.json"))->name] = $dir;
41+
if ($filesystem->exists($composer = "$dir/composer.json")) {
42+
$sfPackages[json_decode(file_get_contents($composer))->name] = $dir;
43+
}
4044
}
4145

42-
$filesystem = new Filesystem();
4346
foreach (glob("$argv[1]/vendor/symfony/*", GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
4447
$package = 'symfony/'.basename($dir);
4548
if (is_link($dir)) {
@@ -57,3 +60,7 @@ foreach (glob("$argv[1]/vendor/symfony/*", GLOB_ONLYDIR | GLOB_NOSORT) as $dir)
5760
$filesystem->symlink($sfDir, $dir);
5861
echo "\"$package\" has been linked to \"$sfPackages[$package]\".".PHP_EOL;
5962
}
63+
64+
foreach (glob("$argv[1]/var/cache/*") as $cacheDir) {
65+
$filesystem->remove($cacheDir);
66+
}

‎src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/bin/simple-phpunit
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
5959
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION"));
6060
}
6161
if (extension_loaded('openssl') && ini_get('allow_url_fopen') && !isset($_SERVER['http_proxy']) && !isset($_SERVER['https_proxy'])) {
62-
stream_copy_to_stream(fopen("https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip", 'rb'), fopen("$PHPUNIT_VERSION.zip", 'wb'));
62+
$remoteZip = "https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip";
63+
$remoteZipStream = @fopen($remoteZip, 'rb');
64+
if (!$remoteZipStream) {
65+
throw new \RuntimeException("Could not find $remoteZip");
66+
}
67+
stream_copy_to_stream($remoteZipStream, fopen("$PHPUNIT_VERSION.zip", 'wb'));
6368
} else {
6469
@unlink("$PHPUNIT_VERSION.zip");
6570
passthru("wget https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip");

‎src/Symfony/Bridge/Twig/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"symfony/asset": "~3.4|~4.0",
2525
"symfony/dependency-injection": "~3.4|~4.0",
2626
"symfony/finder": "~3.4|~4.0",
27-
"symfony/form": "~3.4-beta4|~4.0-beta4",
27+
"symfony/form": "~3.4|~4.0",
2828
"symfony/http-foundation": "~3.4|~4.0",
2929
"symfony/http-kernel": "~3.4|~4.0",
3030
"symfony/polyfill-intl-icu": "~1.0",

‎src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private function createRedirectController($httpPort = null, $httpsPort = null)
252252
return new RedirectController(null, $httpPort, $httpsPort);
253253
}
254254

255-
public function assertRedirectUrl(Response $returnResponse, $expectedUrl)
255+
private function assertRedirectUrl(Response $returnResponse, $expectedUrl)
256256
{
257257
$this->assertTrue($returnResponse->isRedirect($expectedUrl), "Expected: $expectedUrl\nGot: ".$returnResponse->headers->get('Location'));
258258
}

‎src/Symfony/Bundle/FrameworkBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/cache": "~3.4|~4.0",
2222
"symfony/dependency-injection": "~3.4|~4.0",
2323
"symfony/config": "~3.4|~4.0",
24-
"symfony/event-dispatcher": "~3.4-beta4|~4.0-beta4",
24+
"symfony/event-dispatcher": "~3.4|~4.0",
2525
"symfony/http-foundation": "~3.4|~4.0",
2626
"symfony/http-kernel": "~3.4|~4.0",
2727
"symfony/polyfill-mbstring": "~1.0",

‎src/Symfony/Bundle/SecurityBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/composer.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": "^7.1.3",
2020
"ext-xml": "*",
21-
"symfony/security": "~3.4-beta5|~4.0-beta5",
21+
"symfony/security": "~3.4|~4.0",
2222
"symfony/dependency-injection": "~3.4|~4.0",
2323
"symfony/http-kernel": "~3.4|~4.0"
2424
},
@@ -30,7 +30,7 @@
3030
"symfony/dom-crawler": "~3.4|~4.0",
3131
"symfony/event-dispatcher": "~3.4|~4.0",
3232
"symfony/form": "~3.4|~4.0",
33-
"symfony/framework-bundle": "~3.4-rc1|~4.0-rc1",
33+
"symfony/framework-bundle": "~3.4|~4.0",
3434
"symfony/http-foundation": "~3.4|~4.0",
3535
"symfony/translation": "~3.4|~4.0",
3636
"symfony/twig-bundle": "~3.4|~4.0",

‎src/Symfony/Bundle/TwigBundle/Resources/views/base_js.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Resources/views/base_js.html.twig
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{# This file is based on WebProfilerBundle/Resources/views/Profiler/base_js.html.twig.
22
If you make any change in this file, verify the same change is needed in the other file. #}
3-
<script{% if csp_script_nonce is defined and csp_script_nonce %} nonce={{ csp_script_nonce }}{% endif %}>/*<![CDATA[*/
3+
<script{% if csp_script_nonce is defined and csp_script_nonce %} nonce="{{ csp_script_nonce }}"{% endif %}>/*<![CDATA[*/
44
{# Caution: the contents of this file are processed by Twig before loading
55
them as JavaScript source code. Always use '/*' comments instead
66
of '//' comments to avoid impossible-to-debug side-effects #}

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{# This file is partially duplicated in TwigBundle/Resources/views/base_js.html.twig. If you
22
make any change in this file, verify the same change is needed in the other file. #}
3-
<script{% if csp_script_nonce is defined and csp_script_nonce %} nonce={{ csp_script_nonce }}{% endif %}>/*<![CDATA[*/
3+
<script{% if csp_script_nonce is defined and csp_script_nonce %} nonce="{{ csp_script_nonce }}"{% endif %}>/*<![CDATA[*/
44
{# Caution: the contents of this file are processed by Twig before loading
55
them as JavaScript source code. Always use '/*' comments instead
66
of '//' comments to avoid impossible-to-debug side-effects #}

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<style{% if csp_style_nonce %} nonce="{{ csp_style_nonce }}"{% endif %}>
44
{{ include('@WebProfiler/Profiler/toolbar.css.twig') }}
55
</style>
6-
<script{% if csp_script_nonce %} nonce={{ csp_script_nonce }}{% endif %}>/*<![CDATA[*/
6+
<script{% if csp_script_nonce %} nonce="{{ csp_script_nonce }}"{% endif %}>/*<![CDATA[*/
77
(function () {
88
Sfjs.load(
99
'sfwdt{{ token }}',

‎src/Symfony/Component/Console/Application.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Application.php
+28-5Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
4040
use Symfony\Component\Console\Exception\CommandNotFoundException;
4141
use Symfony\Component\Console\Exception\LogicException;
42+
use Symfony\Component\Debug\ErrorHandler;
43+
use Symfony\Component\Debug\Exception\FatalThrowableError;
4244
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
4345

4446
/**
@@ -116,6 +118,25 @@ public function run(InputInterface $input = null, OutputInterface $output = null
116118
$output = new ConsoleOutput();
117119
}
118120

121+
$renderException = function ($e) use ($output) {
122+
if (!$e instanceof \Exception) {
123+
$e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
124+
}
125+
if ($output instanceof ConsoleOutputInterface) {
126+
$this->renderException($e, $output->getErrorOutput());
127+
} else {
128+
$this->renderException($e, $output);
129+
}
130+
};
131+
if ($phpHandler = set_exception_handler($renderException)) {
132+
restore_exception_handler();
133+
if (!is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) {
134+
$debugHandler = true;
135+
} elseif ($debugHandler = $phpHandler[0]->setExceptionHandler($renderException)) {
136+
$phpHandler[0]->setExceptionHandler($debugHandler);
137+
}
138+
}
139+
119140
$this->configureIO($input, $output);
120141

121142
try {
@@ -125,11 +146,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null
125146
throw $e;
126147
}
127148

128-
if ($output instanceof ConsoleOutputInterface) {
129-
$this->renderException($e, $output->getErrorOutput());
130-
} else {
131-
$this->renderException($e, $output);
132-
}
149+
$renderException($e);
133150

134151
$exitCode = $e->getCode();
135152
if (is_numeric($exitCode)) {
@@ -140,6 +157,12 @@ public function run(InputInterface $input = null, OutputInterface $output = null
140157
} else {
141158
$exitCode = 1;
142159
}
160+
} finally {
161+
if (!$phpHandler) {
162+
restore_exception_handler();
163+
} elseif (!$debugHandler) {
164+
$phpHandler[0]->setExceptionHandler(null);
165+
}
143166
}
144167

145168
if ($this->autoExit) {

‎src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
1515
use Symfony\Component\DependencyInjection\ContainerInterface;
1616
use Symfony\Component\DependencyInjection\Definition;
17+
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
1718
use Symfony\Component\DependencyInjection\ExpressionLanguage;
1819
use Symfony\Component\DependencyInjection\Reference;
1920
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -148,6 +149,10 @@ private function getDefinitionId(string $id): ?string
148149
private function getExpressionLanguage()
149150
{
150151
if (null === $this->expressionLanguage) {
152+
if (!class_exists(ExpressionLanguage::class)) {
153+
throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
154+
}
155+
151156
$providers = $this->container->getExpressionLanguageProviders();
152157
$this->expressionLanguage = new ExpressionLanguage(null, $providers, function ($arg) {
153158
if ('""' === substr_replace($arg, '', 1, -1)) {

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+19-5Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ public function getCompiler()
467467
*/
468468
public function set($id, $service)
469469
{
470+
$id = (string) $id;
471+
470472
if ($this->isCompiled() && (isset($this->definitions[$id]) && !$this->definitions[$id]->isSynthetic())) {
471473
// setting a synthetic service on a compiled container is alright
472474
throw new BadMethodCallException(sprintf('Setting service "%s" for an unknown or non-synthetic service definition on a compiled container is not allowed.', $id));
@@ -484,7 +486,7 @@ public function set($id, $service)
484486
*/
485487
public function removeDefinition($id)
486488
{
487-
if (isset($this->definitions[$id])) {
489+
if (isset($this->definitions[$id = (string) $id])) {
488490
unset($this->definitions[$id]);
489491
$this->removedIds[$id] = true;
490492
}
@@ -499,6 +501,8 @@ public function removeDefinition($id)
499501
*/
500502
public function has($id)
501503
{
504+
$id = (string) $id;
505+
502506
return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
503507
}
504508

@@ -519,7 +523,7 @@ public function has($id)
519523
*/
520524
public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
521525
{
522-
if ($this->isCompiled() && isset($this->removedIds[$id]) && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
526+
if ($this->isCompiled() && isset($this->removedIds[$id = (string) $id]) && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
523527
return parent::get($id);
524528
}
525529

@@ -779,6 +783,8 @@ public function setAliases(array $aliases)
779783
*/
780784
public function setAlias($alias, $id)
781785
{
786+
$alias = (string) $alias;
787+
782788
if (is_string($id)) {
783789
$id = new Alias($id);
784790
} elseif (!$id instanceof Alias) {
@@ -801,7 +807,7 @@ public function setAlias($alias, $id)
801807
*/
802808
public function removeAlias($alias)
803809
{
804-
if (isset($this->aliasDefinitions[$alias])) {
810+
if (isset($this->aliasDefinitions[$alias = (string) $alias])) {
805811
unset($this->aliasDefinitions[$alias]);
806812
$this->removedIds[$alias] = true;
807813
}
@@ -816,7 +822,7 @@ public function removeAlias($alias)
816822
*/
817823
public function hasAlias($id)
818824
{
819-
return isset($this->aliasDefinitions[$id]);
825+
return isset($this->aliasDefinitions[$id = (string) $id]);
820826
}
821827

822828
/**
@@ -840,6 +846,8 @@ public function getAliases()
840846
*/
841847
public function getAlias($id)
842848
{
849+
$id = (string) $id;
850+
843851
if (!isset($this->aliasDefinitions[$id])) {
844852
throw new InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $id));
845853
}
@@ -928,6 +936,8 @@ public function setDefinition($id, Definition $definition)
928936
throw new BadMethodCallException('Adding definition to a compiled container is not allowed');
929937
}
930938

939+
$id = (string) $id;
940+
931941
unset($this->aliasDefinitions[$id], $this->removedIds[$id]);
932942

933943
return $this->definitions[$id] = $definition;
@@ -942,7 +952,7 @@ public function setDefinition($id, Definition $definition)
942952
*/
943953
public function hasDefinition($id)
944954
{
945-
return isset($this->definitions[$id]);
955+
return isset($this->definitions[(string) $id]);
946956
}
947957

948958
/**
@@ -956,6 +966,8 @@ public function hasDefinition($id)
956966
*/
957967
public function getDefinition($id)
958968
{
969+
$id = (string) $id;
970+
959971
if (!isset($this->definitions[$id])) {
960972
throw new ServiceNotFoundException($id);
961973
}
@@ -976,6 +988,8 @@ public function getDefinition($id)
976988
*/
977989
public function findDefinition($id)
978990
{
991+
$id = (string) $id;
992+
979993
while (isset($this->aliasDefinitions[$id])) {
980994
$id = (string) $this->aliasDefinitions[$id];
981995
}

‎src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,16 @@ public function dump(array $options = array())
224224
{$namespaceLine}
225225
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
226226
227-
if (!class_exists(\\Container{$hash}\\{$options['class']}::class, false)) {
228-
require __DIR__.'/Container{$hash}/{$options['class']}.php';
227+
if (\\class_exists(\\Container{$hash}\\{$options['class']}::class, false)) {
228+
// no-op
229+
} elseif (!include __DIR__.'/Container{$hash}/{$options['class']}.php') {
230+
touch(__DIR__.'/Container{$hash}.legacy');
231+
232+
return;
229233
}
230234
231-
if (!class_exists({$options['class']}::class, false)) {
232-
class_alias(\\Container{$hash}\\{$options['class']}::class, {$options['class']}::class, false);
235+
if (!\\class_exists({$options['class']}::class, false)) {
236+
\\class_alias(\\Container{$hash}\\{$options['class']}::class, {$options['class']}::class, false);
233237
}
234238
235239
return new \\Container{$hash}\\{$options['class']}();
@@ -424,13 +428,13 @@ private function addServiceInclude(string $cId, Definition $definition, \SplObje
424428
}
425429

426430
foreach (array_diff_key(array_flip($lineage), $this->inlinedRequires) as $file => $class) {
427-
$code .= sprintf(" require_once %s;\n", $file);
431+
$code .= sprintf(" include_once %s;\n", $file);
428432
}
429433
}
430434

431435
foreach ($inlinedDefinitions as $def) {
432436
if ($file = $def->getFile()) {
433-
$code .= sprintf(" require_once %s;\n", $this->dumpValue($file));
437+
$code .= sprintf(" include_once %s;\n", $this->dumpValue($file));
434438
}
435439
}
436440

@@ -1082,7 +1086,7 @@ private function addInlineRequires() :string
10821086
foreach ($lineage as $file) {
10831087
if (!isset($this->inlinedRequires[$file])) {
10841088
$this->inlinedRequires[$file] = true;
1085-
$code .= sprintf(" require_once %s;\n", $file);
1089+
$code .= sprintf(" include_once %s;\n", $file);
10861090
}
10871091
}
10881092

‎src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,24 @@ public function testArgumentsHaveHigherPriorityThanBindings()
13101310
$this->assertSame('via-argument', $container->get('foo')->class1->identifier);
13111311
$this->assertSame('via-bindings', $container->get('foo')->class2->identifier);
13121312
}
1313+
1314+
public function testIdCanBeAnObjectAsLongAsItCanBeCastToString()
1315+
{
1316+
$id = new Reference('another_service');
1317+
$aliasId = new Reference('alias_id');
1318+
1319+
$container = new ContainerBuilder();
1320+
$container->set($id, new \stdClass());
1321+
$container->setAlias($aliasId, 'another_service');
1322+
1323+
$this->assertTrue($container->has('another_service'));
1324+
$this->assertTrue($container->has($id));
1325+
$this->assertTrue($container->hasAlias('alias_id'));
1326+
$this->assertTrue($container->hasAlias($aliasId));
1327+
1328+
$container->removeAlias($aliasId);
1329+
$container->removeDefinition($id);
1330+
}
13131331
}
13141332

13151333
class FooClass

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
231231
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
232232
// Returns the public 'method_call1' shared service.
233233

234-
require_once ($this->targetDirs[0].'/Fixtures/includes/foo.php');
234+
include_once ($this->targetDirs[0].'/Fixtures/includes/foo.php');
235235

236236
$this->services['method_call1'] = $instance = new \Bar\FooClass();
237237

@@ -483,12 +483,16 @@ class ProjectServiceContainer extends Container
483483

484484
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
485485

486-
if (!class_exists(\Container%s\ProjectServiceContainer::class, false)) {
487-
require __DIR__.'/Container%s/ProjectServiceContainer.php';
486+
if (\class_exists(\Container%s\ProjectServiceContainer::class, false)) {
487+
// no-op
488+
} elseif (!include __DIR__.'/Container%s/ProjectServiceContainer.php') {
489+
touch(__DIR__.'/Container%s.legacy');
490+
491+
return;
488492
}
489493

490-
if (!class_exists(ProjectServiceContainer::class, false)) {
491-
class_alias(\Container%s\ProjectServiceContainer::class, ProjectServiceContainer::class, false);
494+
if (!\class_exists(ProjectServiceContainer::class, false)) {
495+
\class_alias(\Container%s\ProjectServiceContainer::class, ProjectServiceContainer::class, false);
492496
}
493497

494498
return new \Container%s\ProjectServiceContainer();

0 commit comments

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