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

Skip to content

Commit 78822af

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

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -454,22 +454,26 @@ private function darwinRealpath($real)
454454
if (isset(self::$darwinCache[$kDir])) {
455455
$real = self::$darwinCache[$kDir][0];
456456
} else {
457-
$dir = getcwd();
458-
chdir($real);
459-
$real = getcwd().'/';
460-
chdir($dir);
461-
462-
$dir = $real;
463-
$k = $kDir;
464-
$i = \strlen($dir) - 1;
465-
while (!isset(self::$darwinCache[$k])) {
466-
self::$darwinCache[$k] = [$dir, []];
467-
self::$darwinCache[$dir] = &self::$darwinCache[$k];
468-
469-
while ('/' !== $dir[--$i]) {
457+
try{
458+
$dir = getcwd();
459+
chdir($real);
460+
$real = getcwd().'/';
461+
chdir($dir);
462+
463+
$dir = $real;
464+
$k = $kDir;
465+
$i = \strlen($dir) - 1;
466+
while (!isset(self::$darwinCache[$k])) {
467+
self::$darwinCache[$k] = [$dir, []];
468+
self::$darwinCache[$dir] = &self::$darwinCache[$k];
469+
470+
while ('/' !== $dir[--$i]) {
471+
}
472+
$k = substr($k, 0, ++$i);
473+
$dir = substr($dir, 0, $i--);
470474
}
471-
$k = substr($k, 0, ++$i);
472-
$dir = substr($dir, 0, $i--);
475+
} catch (\ErrorException $exception){
476+
return $real;
473477
}
474478
}
475479
}

0 commit comments

Comments
 (0)
0