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

@@ -16,10 +16,16 @@ namespace Symfony\Component\Config\Exception;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class FileLoaderImportCircularReferenceException extends FileLoaderLoadException
class FileLoaderImportCircularReferenceException extends LoaderLoadException
{
public function __construct(array $resources, $code = null, $previous = null)
public function __construct(array $resources, ?int $code = 0, \Throwable $previous = null)
{
if (null === $code) {
trigger_deprecation('symfony/config', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__);
$code = 0;
}
$message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]);
\Exception::__construct($message, $code, $previous);

View File

@@ -20,7 +20,7 @@ class FileLocatorFileNotFoundException extends \InvalidArgumentException
{
private $paths;
public function __construct($message = '', $code = 0, $previous = null, array $paths = [])
public function __construct(string $message = '', int $code = 0, \Throwable $previous = null, array $paths = [])
{
parent::__construct($message, $code, $previous);

View File

@@ -16,17 +16,23 @@ namespace Symfony\Component\Config\Exception;
*
* @author Ryan Weaver <ryan@thatsquality.com>
*/
class FileLoaderLoadException extends \Exception
class LoaderLoadException extends \Exception
{
/**
* @param string $resource The resource that could not be imported
* @param string $sourceResource The original resource importing the new resource
* @param int $code The error code
* @param \Exception $previous A previous exception
* @param string $type The type of resource
* @param string $resource The resource that could not be imported
* @param string|null $sourceResource The original resource importing the new resource
* @param int|null $code The error code
* @param \Throwable|null $previous A previous exception
* @param string|null $type The type of resource
*/
public function __construct($resource, $sourceResource = null, $code = null, $previous = null, $type = null)
public function __construct(string $resource, string $sourceResource = null, ?int $code = 0, \Throwable $previous = null, string $type = null)
{
if (null === $code) {
trigger_deprecation('symfony/config', '5.3', 'Passing null as $code to "%s()" is deprecated, pass 0 instead.', __METHOD__);
$code = 0;
}
$message = '';
if ($previous) {
// Include the previous exception, to help the user see what might be the underlying cause
@@ -42,17 +48,17 @@ class FileLoaderLoadException extends \Exception
// show tweaked trace to complete the human readable sentence
if (null === $sourceResource) {
$message .= sprintf('(which is loaded in resource "%s")', $this->varToString($resource));
$message .= sprintf('(which is loaded in resource "%s")', $resource);
} else {
$message .= sprintf('(which is being imported from "%s")', $this->varToString($sourceResource));
$message .= sprintf('(which is being imported from "%s")', $sourceResource);
}
$message .= '.';
// if there's no previous message, present it the default way
} elseif (null === $sourceResource) {
$message .= sprintf('Cannot load resource "%s".', $this->varToString($resource));
$message .= sprintf('Cannot load resource "%s".', $resource);
} else {
$message .= sprintf('Cannot import resource "%s" from "%s".', $this->varToString($resource), $this->varToString($sourceResource));
$message .= sprintf('Cannot import resource "%s" from "%s".', $resource, $sourceResource);
}
// Is the resource located inside a bundle?
@@ -64,7 +70,7 @@ class FileLoaderLoadException extends \Exception
} elseif (null !== $type) {
// maybe there is no loader for this specific type
if ('annotation' === $type) {
$message .= ' Make sure annotations are installed and enabled.';
$message .= ' Make sure to use PHP 8+ or that annotations are installed and enabled.';
} else {
$message .= sprintf(' Make sure there is a loader supporting the "%s" type.', $type);
}