migration symfony 5 4 (#300)

* symfony 5.4 (diff dev)

* symfony 5.4 (working)

* symfony 5.4 (update autoload)

* symfony 5.4 (remove swiftmailer mailer implementation)

* symfony 5.4 (php doc and split Global accessor class)


### Impacted packages:

composer require php:">=7.2.5 <8.0.0" symfony/console:5.4.* symfony/dotenv:5.4.* symfony/framework-bundle:5.4.* symfony/twig-bundle:5.4.* symfony/yaml:5.4.* --update-with-dependencies

composer require symfony/stopwatch:5.4.* symfony/web-profiler-bundle:5.4.* --dev --update-with-dependencies
This commit is contained in:
bdalsass
2022-06-16 09:13:24 +02:00
committed by GitHub
parent abb13b70b9
commit 79da71ecf8
2178 changed files with 87439 additions and 59451 deletions

View File

@@ -15,18 +15,17 @@ namespace Symfony\Component\Config\Definition;
* This class is the entry point for config normalization/merging/finalization.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*
* @final
*/
class Processor
{
/**
* Processes an array of configurations.
*
* @param NodeInterface $configTree The node tree describing the configuration
* @param array $configs An array of configuration items to process
*
* @return array The processed configuration
* @param array $configs An array of configuration items to process
*/
public function process(NodeInterface $configTree, array $configs)
public function process(NodeInterface $configTree, array $configs): array
{
$currentConfig = [];
foreach ($configs as $config) {
@@ -40,12 +39,9 @@ class Processor
/**
* Processes an array of configurations.
*
* @param ConfigurationInterface $configuration The configuration class
* @param array $configs An array of configuration items to process
*
* @return array The processed configuration
* @param array $configs An array of configuration items to process
*/
public function processConfiguration(ConfigurationInterface $configuration, array $configs)
public function processConfiguration(ConfigurationInterface $configuration, array $configs): array
{
return $this->process($configuration->getConfigTreeBuilder()->buildTree(), $configs);
}
@@ -70,10 +66,8 @@ class Processor
* @param array $config A config array
* @param string $key The key to normalize
* @param string $plural The plural form of the key if it is irregular
*
* @return array
*/
public static function normalizeConfig($config, $key, $plural = null)
public static function normalizeConfig(array $config, string $key, string $plural = null): array
{
if (null === $plural) {
$plural = $key.'s';
@@ -86,10 +80,10 @@ class Processor
if (isset($config[$key])) {
if (\is_string($config[$key]) || !\is_int(key($config[$key]))) {
// only one
return [$config[$key]];
return [$config[$key]];
}
return $config[$key];
return $config[$key];
}
return [];