8000 [TwigBridge] Added bundle name suggestion on wrongly overrided templates paths by pmontoya · Pull Request #26919 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[TwigBridge] Added bundle name suggestion on wrongly overrided templates paths #26919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 19, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refs #26898
Remove unnecessary loop
Trim messages on build rather than on display
  • Loading branch information
Pascal Montoya committed Jun 18, 2018
commit acfb325a351afc09f08c00b0a91fbcd37f1b2def
22 changes: 5 additions & 17 deletions src/Symfony/Bridge/Twig/Command/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$data['tests'] = array_keys($data['tests']);
$data['loader_paths'] = $this->getLoaderPaths();
if ($wrongBundles = $this->findWrongBundleOverrides()) {
$messages = $this->buildWarningMessages($wrongBundles);
$data['warnings'] = array_reduce(
$messages,
function ($carry, $message) {
$carry[] = $message;

return $carry;
},
array()
);
$data['warnings'] = $this->buildWarningMessages($wrongBundles);
}

$io->writeln(json_encode($data));
Expand Down Expand Up @@ -143,12 +134,9 @@ function ($carry, $message) {
$io->section('Loader Paths');
$io->table(array('Namespace', 'Paths'), $rows);
$messages = $this->buildWarningMessages($this->findWrongBundleOverrides());
array_walk(
$messages,
function ($message) use ($io) {
$io->warning(trim($message));
}
);
foreach ($messages as $message) {
$io->warning($message);
}

return 0;
}
Expand Down Expand Up @@ -344,7 +332,7 @@ private function buildWarningMessages(array $wrongBundles): array
}
}
}
$messages[] = $message;
$messages[] = trim($message);
}

return $messages;
Expand Down
0