Augmentation vers version 3.3.0
This commit is contained in:
@@ -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;
|
||||
@@ -58,17 +57,7 @@ class TwigExtractor extends AbstractFileExtractor implements ExtractorInterface
|
||||
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;
|
||||
if (method_exists($e, 'setSourceContext')) {
|
||||
$e->setSourceContext(new Source('', $name, $path));
|
||||
} else {
|
||||
$e->setTemplateName($name);
|
||||
}
|
||||
}
|
||||
|
||||
throw $e;
|
||||
// ignore errors, these should be fixed by using the linter
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,9 +95,7 @@ class TwigExtractor extends AbstractFileExtractor implements ExtractorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|array $directory
|
||||
*
|
||||
* @return array
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function extractFromDirectory($directory)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user