Skip to content

Commit

Permalink
Fix the translation commands when a template contains a syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Nov 29, 2019
1 parent fa783f9 commit f588c6e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Symfony/Bridge/Twig/Translation/TwigExtractor.php
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Translation;

use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
use Symfony\Component\Translation\Extractor\AbstractFileExtractor;
use Symfony\Component\Translation\Extractor\ExtractorInterface;
use Symfony\Component\Translation\MessageCatalogue;
Expand Down Expand Up @@ -58,13 +57,7 @@ public function extract($resource, MessageCatalogue $catalogue)
try {
$this->extractTemplate(file_get_contents($file->getPathname()), $catalogue);
} catch (Error $e) {
if ($file instanceof \SplFileInfo) {
$path = $file->getRealPath() ?: $file->getPathname();
$name = $file instanceof SplFileInfo ? $file->getRelativePathname() : $path;
$e->setSourceContext(new Source('', $name, $path));
}

throw $e;
// ignore errors, these should be fixed by using the linter
}
}
}
Expand Down

0 comments on commit f588c6e

Please sign in to comment.