mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 03:40:50 +00:00
Updated Rector to commit e7f551069cd3efc29ccd7089f432f22556f52b0c
e7f551069c
fix
This commit is contained in:
parent
a267280daf
commit
4930b08d44
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '6cf9a544edb1bf6e432e9e4f0767c83eea77e76e';
|
||||
public const PACKAGE_VERSION = 'e7f551069cd3efc29ccd7089f432f22556f52b0c';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-08-16 01:41:30';
|
||||
public const RELEASE_DATE = '2023-08-16 01:53:37';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit9a92502ba4241ad709e09cdec4c268e5::getLoader();
|
||||
return ComposerAutoloaderInit282eb222ebec4ee71ff30f434a2553fa::getLoader();
|
||||
|
|
1
vendor/composer/autoload_files.php
vendored
1
vendor/composer/autoload_files.php
vendored
|
@ -10,7 +10,6 @@ return array(
|
|||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||
'9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php',
|
||||
'4508688f3cab21375725e8d11ca194a2' => $baseDir . '/src/constants.php',
|
||||
'30bca7fff093e8069bed7c55247e2bf8' => $baseDir . '/src/functions/node_helper.php',
|
||||
|
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit9a92502ba4241ad709e09cdec4c268e5
|
||||
class ComposerAutoloaderInit282eb222ebec4ee71ff30f434a2553fa
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInit9a92502ba4241ad709e09cdec4c268e5
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit9a92502ba4241ad709e09cdec4c268e5', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit282eb222ebec4ee71ff30f434a2553fa', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit9a92502ba4241ad709e09cdec4c268e5', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit282eb222ebec4ee71ff30f434a2553fa', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit9a92502ba4241ad709e09cdec4c268e5::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit282eb222ebec4ee71ff30f434a2553fa::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit9a92502ba4241ad709e09cdec4c268e5::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit282eb222ebec4ee71ff30f434a2553fa::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
9
vendor/composer/autoload_static.php
vendored
9
vendor/composer/autoload_static.php
vendored
|
@ -4,14 +4,13 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit9a92502ba4241ad709e09cdec4c268e5
|
||||
class ComposerStaticInit282eb222ebec4ee71ff30f434a2553fa
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
||||
'9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php',
|
||||
'4508688f3cab21375725e8d11ca194a2' => __DIR__ . '/../..' . '/src/constants.php',
|
||||
'30bca7fff093e8069bed7c55247e2bf8' => __DIR__ . '/../..' . '/src/functions/node_helper.php',
|
||||
|
@ -2638,9 +2637,9 @@ class ComposerStaticInit9a92502ba4241ad709e09cdec4c268e5
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit9a92502ba4241ad709e09cdec4c268e5::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit9a92502ba4241ad709e09cdec4c268e5::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit9a92502ba4241ad709e09cdec4c268e5::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit282eb222ebec4ee71ff30f434a2553fa::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit282eb222ebec4ee71ff30f434a2553fa::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit282eb222ebec4ee71ff30f434a2553fa::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
70
vendor/composer/installed.json
vendored
70
vendor/composer/installed.json
vendored
|
@ -2187,76 +2187,6 @@
|
|||
],
|
||||
"install-path": "..\/symfony\/console"
|
||||
},
|
||||
{
|
||||
"name": "symfony\/deprecation-contracts",
|
||||
"version": "v3.3.0",
|
||||
"version_normalized": "3.3.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/deprecation-contracts.git",
|
||||
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/deprecation-contracts\/zipball\/7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"time": "2023-05-23T14:45:45+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.4-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony\/contracts",
|
||||
"url": "https:\/\/github.com\/symfony\/contracts"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"function.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https:\/\/packagist.org\/downloads\/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https:\/\/symfony.com\/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https:\/\/symfony.com",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/deprecation-contracts\/tree\/v3.3.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https:\/\/symfony.com\/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/github.com\/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/tidelift.com\/funding\/github\/packagist\/symfony\/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"install-path": "..\/symfony\/deprecation-contracts"
|
||||
},
|
||||
{
|
||||
"name": "symfony\/filesystem",
|
||||
"version": "v6.3.1",
|
||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
5
vendor/scoper-autoload.php
vendored
5
vendor/scoper-autoload.php
vendored
|
@ -16,10 +16,5 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix202308\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('trigger_deprecation')) {
|
||||
function trigger_deprecation() {
|
||||
return \RectorPrefix202308\trigger_deprecation(...func_get_args());
|
||||
}
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
|
4
vendor/symfony/console/Application.php
vendored
4
vendor/symfony/console/Application.php
vendored
|
@ -914,7 +914,7 @@ class Application implements ResetInterface
|
|||
$exitCode = $command->handleSignal($signal, $exitCode);
|
||||
// BC layer for Symfony <= 5
|
||||
if (null === $exitCode) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', \get_debug_type($command));
|
||||
// \trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', \get_debug_type($command));
|
||||
$exitCode = 0;
|
||||
}
|
||||
}
|
||||
|
@ -931,7 +931,7 @@ class Application implements ResetInterface
|
|||
$exitCode = $command->handleSignal($signal);
|
||||
// BC layer for Symfony <= 5
|
||||
if (null === $exitCode) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', \get_debug_type($command));
|
||||
// \trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', \get_debug_type($command));
|
||||
$exitCode = 0;
|
||||
}
|
||||
if (\false !== $exitCode) {
|
||||
|
|
6
vendor/symfony/console/Command/Command.php
vendored
6
vendor/symfony/console/Command/Command.php
vendored
|
@ -115,7 +115,7 @@ class Command
|
|||
if ($class !== $r->class || null === static::$defaultName) {
|
||||
return null;
|
||||
}
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultName" for setting a command name is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class);
|
||||
// \trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultName" for setting a command name is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class);
|
||||
return static::$defaultName;
|
||||
}
|
||||
public static function getDefaultDescription() : ?string
|
||||
|
@ -129,7 +129,7 @@ class Command
|
|||
if ($class !== $r->class || null === static::$defaultDescription) {
|
||||
return null;
|
||||
}
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultDescription" for setting a command description is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class);
|
||||
// \trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultDescription" for setting a command description is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class);
|
||||
return static::$defaultDescription;
|
||||
}
|
||||
/**
|
||||
|
@ -173,7 +173,7 @@ class Command
|
|||
public function setApplication(Application $application = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
$this->application = $application;
|
||||
if ($application) {
|
||||
|
|
|
@ -45,7 +45,7 @@ final class LazyCommand extends Command
|
|||
public function setApplication(Application $application = null) : void
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
if ($this->command instanceof parent) {
|
||||
$this->command->setApplication($application);
|
||||
|
|
|
@ -22,14 +22,14 @@ final class NullOutputFormatterStyle implements OutputFormatterStyleInterface
|
|||
public function setBackground(string $color = null) : void
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
// do nothing
|
||||
}
|
||||
public function setForeground(string $color = null) : void
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
// do nothing
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
|||
public function setForeground(string $color = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
$this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
|||
public function setBackground(string $color = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
$this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options);
|
||||
}
|
||||
|
|
2
vendor/symfony/console/Helper/Helper.php
vendored
2
vendor/symfony/console/Helper/Helper.php
vendored
|
@ -26,7 +26,7 @@ abstract class Helper implements HelperInterface
|
|||
public function setHelperSet(HelperSet $helperSet = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
$this->helperSet = $helperSet;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ class InputArgument
|
|||
public function setDefault($default = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
if ($this->isRequired() && null !== $default) {
|
||||
throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
|
||||
|
|
2
vendor/symfony/console/Input/InputOption.php
vendored
2
vendor/symfony/console/Input/InputOption.php
vendored
|
@ -179,7 +179,7 @@ class InputOption
|
|||
public function setDefault($default = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) {
|
||||
throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.');
|
||||
|
|
4
vendor/symfony/console/Question/Question.php
vendored
4
vendor/symfony/console/Question/Question.php
vendored
|
@ -188,7 +188,7 @@ class Question
|
|||
public function setAutocompleterCallback(callable $callback = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
if ($this->hidden && null !== $callback) {
|
||||
throw new LogicException('A hidden question cannot use the autocompleter.');
|
||||
|
@ -204,7 +204,7 @@ class Question
|
|||
public function setValidator(callable $validator = null)
|
||||
{
|
||||
if (1 > \func_num_args()) {
|
||||
\RectorPrefix202308\trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
// \trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
|
||||
}
|
||||
$this->validator = null === $validator ? null : \Closure::fromCallable($validator);
|
||||
return $this;
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
CHANGELOG
|
||||
=========
|
||||
|
||||
The changelog is maintained for all Symfony contracts at the following URL:
|
||||
https://github.com/symfony/contracts/blob/main/CHANGELOG.md
|
19
vendor/symfony/deprecation-contracts/LICENSE
vendored
19
vendor/symfony/deprecation-contracts/LICENSE
vendored
|
@ -1,19 +0,0 @@
|
|||
Copyright (c) 2020-present Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
26
vendor/symfony/deprecation-contracts/README.md
vendored
26
vendor/symfony/deprecation-contracts/README.md
vendored
|
@ -1,26 +0,0 @@
|
|||
Symfony Deprecation Contracts
|
||||
=============================
|
||||
|
||||
A generic function and convention to trigger deprecation notices.
|
||||
|
||||
This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices.
|
||||
|
||||
By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component,
|
||||
the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments.
|
||||
|
||||
The function requires at least 3 arguments:
|
||||
- the name of the Composer package that is triggering the deprecation
|
||||
- the version of the package that introduced the deprecation
|
||||
- the message of the deprecation
|
||||
- more arguments can be provided: they will be inserted in the message using `printf()` formatting
|
||||
|
||||
Example:
|
||||
```php
|
||||
trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
|
||||
```
|
||||
|
||||
This will generate the following message:
|
||||
`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`
|
||||
|
||||
While not recommended, the deprecation notices can be completely ignored by declaring an empty
|
||||
`function trigger_deprecation() {}` in your application.
|
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"name": "symfony\/deprecation-contracts",
|
||||
"type": "library",
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https:\/\/symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https:\/\/symfony.com\/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"function.php"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.4-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony\/contracts",
|
||||
"url": "https:\/\/github.com\/symfony\/contracts"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace RectorPrefix202308;
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
if (!\function_exists('RectorPrefix202308\\trigger_deprecation')) {
|
||||
/**
|
||||
* Triggers a silenced deprecation notice.
|
||||
*
|
||||
* @param string $package The name of the Composer package that is triggering the deprecation
|
||||
* @param string $version The version of the package that introduced the deprecation
|
||||
* @param string $message The message of the deprecation
|
||||
* @param mixed ...$args Values to insert in the message using printf() formatting
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
function trigger_deprecation(string $package, string $version, string $message, ...$args) : void
|
||||
{
|
||||
@\trigger_error(($package || $version ? "Since {$package} {$version}: " : '') . ($args ? \vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
|
@ -7,5 +7,5 @@ use RectorPrefix202308\Symfony\Component\DependencyInjection\Loader\Configurator
|
|||
return static function (ContainerConfigurator $containerConfigurator) : void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->defaults()->public()->autowire();
|
||||
$services->load('RectorPrefix202308\Symplify\\EasyParallel\\', __DIR__ . '/../src')->exclude([__DIR__ . '/../src/ValueObject', __DIR__ . '/../src/Enum', __DIR__ . '/../src/Exception', __DIR__ . '/../src/Contract']);
|
||||
$services->load('Symplify\\EasyParallel\\', __DIR__ . '/../src')->exclude([__DIR__ . '/../src/ValueObject', __DIR__ . '/../src/Enum', __DIR__ . '/../src/Exception', __DIR__ . '/../src/Contract']);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user