Navigation Menu

Skip to content

Commit

Permalink
Merge branch '4.4'
Browse files Browse the repository at this point in the history
* 4.4: (24 commits)
  [Console] Command::execute() should always return int - deprecate returning null
  [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand
  [AnnotationCacheWarmer] add RedirectController to annotation cache
  [WebProfilerBundle] Try to display the most useful panel by default
  Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in the upgrade guide
  fix merge
  [DI] add tests loading calls with returns-clone
  [DI] dont mandate a class on inline services with a factory
  Fixed Redis Sentinel usage when only one Sentinel specified
  [EventDispatcher] Added tests for aliased events.
  Sync Twig templateExists behaviors
  Fix the :only-of-type pseudo class selector
  Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant
  [Mailer] Tweak some code
  [Serializer] Add CsvEncoder tests for PHP 7.4
  Copy phpunit.xsd to a predictable path
  [WebserverBundle] Remove duplicated deprecation message
  remove duplicated test
  [Security/Http] fix parsing X509 emailAddress
  [FrameworkBundle] conflict with VarDumper < 4.4
  ...
  • Loading branch information
nicolas-grekas committed Oct 2, 2019
2 parents 46f6616 + 38fc5d8 commit e1d385e
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 20 deletions.
4 changes: 3 additions & 1 deletion Command/AboutCommand.php
Expand Up @@ -54,7 +54,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

Expand Down Expand Up @@ -100,6 +100,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$io->table([], $rows);

return 0;
}

private static function formatPath(string $path, string $baseDir): string
Expand Down
4 changes: 3 additions & 1 deletion Command/CacheClearCommand.php
Expand Up @@ -72,7 +72,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$fs = $this->filesystem;
$io = new SymfonyStyle($input, $output);
Expand Down Expand Up @@ -175,6 +175,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$io->success(sprintf('Cache for the "%s" environment (debug=%s) was successfully cleared.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));

return 0;
}

private function warmup(string $warmupDir, string $realCacheDir, bool $enableOptionalWarmers = true)
Expand Down
4 changes: 3 additions & 1 deletion Command/CachePoolClearCommand.php
Expand Up @@ -60,7 +60,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$kernel = $this->getApplication()->getKernel();
Expand Down Expand Up @@ -99,5 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$io->success('Cache was successfully cleared.');

return 0;
}
}
6 changes: 4 additions & 2 deletions Command/CachePoolDeleteCommand.php
Expand Up @@ -59,7 +59,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$pool = $input->getArgument('pool');
Expand All @@ -69,13 +69,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (!$cachePool->hasItem($key)) {
$io->note(sprintf('Cache item "%s" does not exist in cache pool "%s".', $key, $pool));

return;
return 0;
}

if (!$cachePool->deleteItem($key)) {
throw new \Exception(sprintf('Cache item "%s" could not be deleted.', $key));
}

$io->success(sprintf('Cache item "%s" was successfully deleted.', $key));

return 0;
}
}
4 changes: 3 additions & 1 deletion Command/CachePoolListCommand.php
Expand Up @@ -51,12 +51,14 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

$io->table(['Pool name'], array_map(function ($pool) {
return [$pool];
}, $this->poolNames));

return 0;
}
}
4 changes: 3 additions & 1 deletion Command/CachePoolPruneCommand.php
Expand Up @@ -57,7 +57,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

Expand All @@ -67,5 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$io->success('Successfully pruned cache pool(s).');

return 0;
}
}
4 changes: 3 additions & 1 deletion Command/CacheWarmupCommand.php
Expand Up @@ -66,7 +66,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

Expand All @@ -80,5 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->cacheWarmer->warmUp($kernel->getContainer()->getParameter('kernel.cache_dir'));

$io->success(sprintf('Cache for the "%s" environment (debug=%s) was successfully warmed.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));

return 0;
}
}
10 changes: 6 additions & 4 deletions Command/ConfigDebugCommand.php
Expand Up @@ -63,7 +63,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$errorIo = $io->getErrorStyle();
Expand All @@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$errorIo->comment('Provide the name of a bundle as the first argument of this command to dump its configuration. (e.g. <comment>debug:config FrameworkBundle</comment>)');
$errorIo->comment('For dumping a specific option, add its path as the second argument of this command. (e.g. <comment>debug:config FrameworkBundle serializer</comment> to dump the <comment>framework.serializer</comment> configuration)');

return;
return 0;
}

$extension = $this->findExtension($name);
Expand Down Expand Up @@ -101,20 +101,22 @@ protected function execute(InputInterface $input, OutputInterface $output)

$io->writeln(Yaml::dump([$extensionAlias => $config], 10));

return;
return 0;
}

try {
$config = $this->getConfigForPath($config, $path, $extensionAlias);
} catch (LogicException $e) {
$errorIo->error($e->getMessage());

return;
return 1;
}

$io->title(sprintf('Current configuration for "%s.%s"', $extensionAlias, $path));

$io->writeln(Yaml::dump($config, 10));

return 0;
}

private function compileContainer(): ContainerBuilder
Expand Down
4 changes: 3 additions & 1 deletion Command/ContainerDebugCommand.php
Expand Up @@ -113,7 +113,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$errorIo = $io->getErrorStyle();
Expand Down Expand Up @@ -179,6 +179,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$errorIo->comment('To search for a specific service, re-run this command with a search term. (e.g. <comment>debug:container log</comment>)');
}
}

return 0;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions Command/EventDispatcherDebugCommand.php
Expand Up @@ -69,7 +69,7 @@ protected function configure()
*
* @throws \LogicException
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

Expand All @@ -78,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (!$this->dispatcher->hasListeners($event)) {
$io->getErrorStyle()->warning(sprintf('The event "%s" does not have any registered listeners.', $event));

return;
return 0;
}

$options = ['event' => $event];
Expand All @@ -89,5 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$options['raw_text'] = $input->getOption('raw');
$options['output'] = $io;
$helper->describe($io, $this->dispatcher, $options);

return 0;
}
}
4 changes: 3 additions & 1 deletion Command/RouterDebugCommand.php
Expand Up @@ -73,7 +73,7 @@ protected function configure()
*
* @throws InvalidArgumentException When route does not exist
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$name = $input->getArgument('name');
Expand Down Expand Up @@ -105,6 +105,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
'output' => $io,
]);
}

return 0;
}

private function findRouteNameContaining(string $name, RouteCollection $routes): array
Expand Down
6 changes: 4 additions & 2 deletions Command/TranslationDebugCommand.php
Expand Up @@ -117,7 +117,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

Expand Down Expand Up @@ -191,7 +191,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

$io->getErrorStyle()->warning($outputMessage);

return;
return 0;
}

// Load the fallback catalogues
Expand Down Expand Up @@ -240,6 +240,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$io->table($headers, $rows);

return 0;
}

private function formatState(int $state): string
Expand Down
4 changes: 3 additions & 1 deletion Command/WorkflowDumpCommand.php
Expand Up @@ -59,7 +59,7 @@ protected function configure()
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$container = $this->getApplication()->getKernel()->getContainer();
$serviceId = $input->getArgument('name');
Expand Down Expand Up @@ -97,5 +97,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
],
];
$output->writeln($dumper->dump($workflow->getDefinition(), $marking, $options));

return 0;
}
}
2 changes: 1 addition & 1 deletion Resources/config/annotations.xml
Expand Up @@ -36,7 +36,7 @@
<service id="annotations.cache_warmer" class="Symfony\Bundle\FrameworkBundle\CacheWarmer\AnnotationsCacheWarmer">
<argument type="service" id="annotations.reader" />
<argument>%kernel.cache_dir%/annotations.php</argument>
<argument>#^Symfony\\(?:Component\\HttpKernel\\|Bundle\\FrameworkBundle\\Controller\\(?!AbstractController$|Controller$))#</argument>
<argument>#^Symfony\\(?:Component\\HttpKernel\\|Bundle\\FrameworkBundle\\Controller\\(?!.*Controller$))#</argument>
<argument>%kernel.debug%</argument>
</service>

Expand Down
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -83,6 +83,7 @@
"symfony/twig-bridge": "<4.4",
"symfony/twig-bundle": "<4.4",
"symfony/validator": "<4.4",
"symfony/var-dumper": "<4.4",
"symfony/workflow": "<4.4"
},
"suggest": {
Expand Down

0 comments on commit e1d385e

Please sign in to comment.