8000 manage Symfony Maker errors when creating entity · symfony/symfony@239d63f · GitHub
[go: up one dir, main page]

Skip to content

Commit 239d63f

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

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/Symfony/Component/Debug/DebugClassLoader.php

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

440440
/**
441441
* `realpath` on MacOSX doesn't normalize the case of characters.
442+
*
443+
* @throws \ErrorException
442444
*/
443445
private function darwinRealpath($real)
444446
{
@@ -454,11 +456,17 @@ private function darwinRealpath($real)
454456
if (isset(self::$darwinCache[$kDir])) {
455457
$real = self::$darwinCache[$kDir][0];
456458
} else {
457-
$dir = getcwd();
458-
chdir($real);
459-
$real = getcwd().'/';
460-
chdir($dir);
461-
459+
try {
460+
$dir = getcwd();
461+
chdir($real);
462+
$real = getcwd().'/';
463+
chdir($dir);
464+
} catch (\ErrorException $exception) {
465+
if (E_WARNING === $exception->getSeverity()) {
466+
return $real;
467+
}
468+
throw $exception;
469+
}
462470
$dir = $real;
463471
$k = $kDir;
464472
$i = \strlen($dir) - 1;

0 commit comments

Comments
 (0)
0