Skip to content

Commit ca5a2c1

Browse files
author
Maria Grazia Patteri
committed
manage Symfony Maker errors when creating entity
1 parent b9f6944 commit ca5a2c1

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ public function checkCase(\ReflectionClass $refl, $file, $class)
439439

440440
/**
441441
* `realpath` on MacOSX doesn't normalize the case of characters.
442+
* @throws \ErrorException
442443
*/
443444
private function darwinRealpath($real)
444445
{
@@ -454,15 +455,21 @@ private function darwinRealpath($real)
454455
if (isset(self::$darwinCache[$kDir])) {
455456
$real = self::$darwinCache[$kDir][0];
456457
} else {
457-
$dir = getcwd();
458-
chdir($real);
459-
$real = getcwd().'/';
460-
chdir($dir);
461-
458+
try {
459+
$dir = getcwd();
460+
chdir($real);
461+
$real = getcwd() . '/';
462+
chdir($dir);
463+
} catch (\ErrorException $exception) {
464+
if ($exception->getSeverity() === E_WARNING) {
465+
return $real;
466+
}
467+
throw $exception;
468+
}
462469
$dir = $real;
463470
$k = $kDir;
464471
$i = \strlen($dir) - 1;
465-
while (!isset(self::$darwinCache[$k])) {
472+
while (! isset(self::$darwinCache[$k])) {
466473
self::$darwinCache[$k] = [$dir, []];
467474
self::$darwinCache[$dir] = &self::$darwinCache[$k];
468475

@@ -471,6 +478,7 @@ private function darwinRealpath($real)
471478
$k = substr($k, 0, ++$i);
472479
$dir = substr($dir, 0, $i--);
473480
}
481+
474482
}
475483
}
476484

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy