Updated Rector to commit d92de44cc5c26ce57fd745e6a4ce0214a23184be

d92de44cc5 use symfony/console with fixed covariant types (#378)
This commit is contained in:
Tomas Votruba 2021-07-04 22:54:28 +00:00
parent bb3e86de23
commit 2d78685dea
23 changed files with 67 additions and 78 deletions

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '904a5a7a1c8dd041524cb51ec3a689ad4cbef436';
public const PACKAGE_VERSION = 'd92de44cc5c26ce57fd745e6a4ce0214a23184be';
/**
* @var string
*/
public const RELEASE_DATE = '2021-07-04 23:04:09';
public const RELEASE_DATE = '2021-07-04 22:34:37';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210704\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2::getLoader();
return ComposerAutoloaderInitba1128297356ef9f1033845735bc38c4::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2
class ComposerAutoloaderInitba1128297356ef9f1033845735bc38c4
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitba1128297356ef9f1033845735bc38c4', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitba1128297356ef9f1033845735bc38c4', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitd12afff95d0d64dcd0dd26bf8b6c1fc2::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitba1128297356ef9f1033845735bc38c4::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitd12afff95d0d64dcd0dd26bf8b6c1fc2::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitba1128297356ef9f1033845735bc38c4::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequired12afff95d0d64dcd0dd26bf8b6c1fc2($fileIdentifier, $file);
composerRequireba1128297356ef9f1033845735bc38c4($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequired12afff95d0d64dcd0dd26bf8b6c1fc2($fileIdentifier, $file)
function composerRequireba1128297356ef9f1033845735bc38c4($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitd12afff95d0d64dcd0dd26bf8b6c1fc2
class ComposerStaticInitba1128297356ef9f1033845735bc38c4
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3845,9 +3845,9 @@ class ComposerStaticInitd12afff95d0d64dcd0dd26bf8b6c1fc2
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitd12afff95d0d64dcd0dd26bf8b6c1fc2::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitd12afff95d0d64dcd0dd26bf8b6c1fc2::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitd12afff95d0d64dcd0dd26bf8b6c1fc2::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitba1128297356ef9f1033845735bc38c4::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitba1128297356ef9f1033845735bc38c4::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitba1128297356ef9f1033845735bc38c4::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1773,17 +1773,17 @@
},
{
"name": "symfony\/console",
"version": "v5.3.2",
"version_normalized": "5.3.2.0",
"version": "5.3.x-dev",
"version_normalized": "5.3.9999999.9999999-dev",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/console.git",
"reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1"
"reference": "8d91db2115506edcf6adef0a8ab2782498597126"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
"reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/8d91db2115506edcf6adef0a8ab2782498597126",
"reference": "8d91db2115506edcf6adef0a8ab2782498597126",
"shasum": ""
},
"require": {
@ -1820,7 +1820,8 @@
"symfony\/lock": "",
"symfony\/process": ""
},
"time": "2021-06-12T09:42:48+00:00",
"time": "2021-07-04T09:35:31+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
@ -1854,7 +1855,7 @@
"terminal"
],
"support": {
"source": "https:\/\/github.com\/symfony\/console\/tree\/v5.3.2"
"source": "https:\/\/github.com\/symfony\/console\/tree\/5.3"
},
"funding": [
{

File diff suppressed because one or more lines are too long

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20210704\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2', false) && !interface_exists('ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2', false) && !trait_exists('ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2', false)) {
spl_autoload_call('RectorPrefix20210704\ComposerAutoloaderInitd12afff95d0d64dcd0dd26bf8b6c1fc2');
if (!class_exists('ComposerAutoloaderInitba1128297356ef9f1033845735bc38c4', false) && !interface_exists('ComposerAutoloaderInitba1128297356ef9f1033845735bc38c4', false) && !trait_exists('ComposerAutoloaderInitba1128297356ef9f1033845735bc38c4', false)) {
spl_autoload_call('RectorPrefix20210704\ComposerAutoloaderInitba1128297356ef9f1033845735bc38c4');
}
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
spl_autoload_call('RectorPrefix20210704\Doctrine\Inflector\Inflector');
@ -3308,9 +3308,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210704\print_node(...func_get_args());
}
}
if (!function_exists('composerRequired12afff95d0d64dcd0dd26bf8b6c1fc2')) {
function composerRequired12afff95d0d64dcd0dd26bf8b6c1fc2() {
return \RectorPrefix20210704\composerRequired12afff95d0d64dcd0dd26bf8b6c1fc2(...func_get_args());
if (!function_exists('composerRequireba1128297356ef9f1033845735bc38c4')) {
function composerRequireba1128297356ef9f1033845735bc38c4() {
return \RectorPrefix20210704\composerRequireba1128297356ef9f1033845735bc38c4(...func_get_args());
}
}
if (!function_exists('parseArgs')) {

View File

@ -367,8 +367,8 @@ class Command
/**
* Adds an argument.
*
* @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
* @param string|string[]|null $default The default value (for InputArgument::OPTIONAL mode only)
* @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
* @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
*
* @throws InvalidArgumentException When argument mode is not valid
*
@ -385,9 +385,9 @@ class Command
/**
* Adds an option.
*
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int|null $mode The option mode: One of the InputOption::VALUE_* constants
* @param string|string[]|bool|null $default The default value (must be null for InputOption::VALUE_NONE)
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int|null $mode The option mode: One of the InputOption::VALUE_* constants
* @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*

View File

@ -30,6 +30,7 @@ abstract class Descriptor implements \RectorPrefix20210704\Symfony\Component\Con
protected $output;
/**
* {@inheritdoc}
* @param object $object
*/
public function describe(\RectorPrefix20210704\Symfony\Component\Console\Output\OutputInterface $output, $object, array $options = [])
{

View File

@ -19,8 +19,6 @@ use RectorPrefix20210704\Symfony\Component\Console\Output\OutputInterface;
interface DescriptorInterface
{
/**
* Describes an object if supported.
*
* @param object $object
*/
public function describe(\RectorPrefix20210704\Symfony\Component\Console\Output\OutputInterface $output, $object, array $options = []);

View File

@ -28,6 +28,7 @@ class MarkdownDescriptor extends \RectorPrefix20210704\Symfony\Component\Console
{
/**
* {@inheritdoc}
* @param object $object
*/
public function describe(\RectorPrefix20210704\Symfony\Component\Console\Output\OutputInterface $output, $object, array $options = [])
{

View File

@ -514,10 +514,10 @@ class Table
}
return new \RectorPrefix20210704\Symfony\Component\Console\Helper\TableRows(function () use($rows, $unmergedRows) : \Traversable {
foreach ($rows as $rowKey => $row) {
(yield $this->fillCells($row));
(yield $row instanceof \RectorPrefix20210704\Symfony\Component\Console\Helper\TableSeparator ? $row : $this->fillCells($row));
if (isset($unmergedRows[$rowKey])) {
foreach ($unmergedRows[$rowKey] as $unmergedRow) {
(yield $this->fillCells($unmergedRow));
foreach ($unmergedRows[$rowKey] as $row) {
(yield $row instanceof \RectorPrefix20210704\Symfony\Component\Console\Helper\TableSeparator ? $row : $this->fillCells($row));
}
}
}
@ -590,7 +590,7 @@ class Table
/**
* fill cells for a row that contains colspan > 1.
*/
private function fillCells($row)
private function fillCells(iterable $row)
{
$newRow = [];
foreach ($row as $column => $cell) {

View File

@ -111,7 +111,7 @@ abstract class Input implements \RectorPrefix20210704\Symfony\Component\Console\
/**
* {@inheritdoc}
*/
public function hasArgument($name)
public function hasArgument(string $name)
{
return $this->definition->hasArgument($name);
}

View File

@ -27,10 +27,10 @@ class InputArgument
private $default;
private $description;
/**
* @param string $name The argument name
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
* @param string $description A description text
* @param string|string[]|null $default The default value (for self::OPTIONAL mode only)
* @param string $name The argument name
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
* @param string $description A description text
* @param mixed $default The default value (for self::OPTIONAL mode only)
*
* @throws InvalidArgumentException When argument mode is not valid
*/
@ -76,7 +76,7 @@ class InputArgument
/**
* Sets the default value.
*
* @param string|string[]|null $default The default value
* @param mixed $default The default value
*
* @throws LogicException When incorrect default value is given
*/
@ -97,7 +97,7 @@ class InputArgument
/**
* Returns the default value.
*
* @return string|string[]|null The default value
* @return mixed
*/
public function getDefault()
{

View File

@ -75,7 +75,7 @@ interface InputInterface
/**
* Returns the argument value for a given argument name.
*
* @return string|string[]|null The argument value
* @return mixed
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
@ -83,7 +83,7 @@ interface InputInterface
/**
* Sets an argument value by name.
*
* @param string|string[]|null $value The argument value
* @param mixed $value The argument value
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
@ -91,11 +91,9 @@ interface InputInterface
/**
* Returns true if an InputArgument object exists by name or position.
*
* @param string|int $name The InputArgument name or position
*
* @return bool true if the InputArgument object exists, false otherwise
*/
public function hasArgument($name);
public function hasArgument(string $name);
/**
* Returns all the given options merged with the default values.
*
@ -105,7 +103,7 @@ interface InputInterface
/**
* Returns the option value for a given option name.
*
* @return string|string[]|bool|null The option value
* @return mixed
*
* @throws InvalidArgumentException When option given doesn't exist
*/
@ -113,7 +111,7 @@ interface InputInterface
/**
* Sets an option value by name.
*
* @param string|string[]|bool|null $value The option value
* @param mixed $value The option value
*
* @throws InvalidArgumentException When option given doesn't exist
*/

View File

@ -45,11 +45,9 @@ class InputOption
private $default;
private $description;
/**
* @param string $name The option name
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int|null $mode The option mode: One of the VALUE_* constants
* @param string $description A description text
* @param string|string[]|bool|null $default The default value (must be null for self::VALUE_NONE)
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int|null $mode The option mode: One of the VALUE_* constants
* @param mixed $default The default value (must be null for self::VALUE_NONE)
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*/
@ -153,7 +151,7 @@ class InputOption
/**
* Sets the default value.
*
* @param string|string[]|bool|null $default The default value
* @param mixed $default The default value
*
* @throws LogicException When incorrect default value is given
*/
@ -174,7 +172,7 @@ class InputOption
/**
* Returns the default value.
*
* @return string|string[]|bool|null The default value
* @return mixed
*/
public function getDefault()
{

View File

@ -82,7 +82,7 @@ class ConsoleSectionOutput extends \RectorPrefix20210704\Symfony\Component\Conso
/**
* {@inheritdoc}
*/
protected function doWrite($message, $newline)
protected function doWrite(string $message, bool $newline)
{
if (!$this->isDecorated()) {
parent::doWrite($message, $newline);

View File

@ -143,13 +143,11 @@ abstract class Output implements \RectorPrefix20210704\Symfony\Component\Console
$message = \strip_tags($this->formatter->format($message));
break;
}
$this->doWrite($message, $newline);
$this->doWrite($message ?? '', $newline);
}
}
/**
* Writes a message to the output.
* @param string $message
* @param bool $newline
*/
protected abstract function doWrite($message, $newline);
protected abstract function doWrite(string $message, bool $newline);
}

View File

@ -58,10 +58,8 @@ class StreamOutput extends \RectorPrefix20210704\Symfony\Component\Console\Outpu
}
/**
* {@inheritdoc}
* @param string $message
* @param bool $newline
*/
protected function doWrite($message, $newline)
protected function doWrite(string $message, bool $newline)
{
if ($newline) {
$message .= \PHP_EOL;

View File

@ -43,7 +43,7 @@ class TrimmedBufferOutput extends \RectorPrefix20210704\Symfony\Component\Consol
/**
* {@inheritdoc}
*/
protected function doWrite($message, $newline)
protected function doWrite(string $message, bool $newline)
{
$this->buffer .= $message;
if ($newline) {

View File

@ -85,13 +85,11 @@ class Question
/**
* Sets whether the user response must be hidden or not.
*
* @param bool $hidden
*
* @return $this
*
* @throws LogicException In case the autocompleter is also used
*/
public function setHidden($hidden)
public function setHidden(bool $hidden)
{
if ($this->autocompleterCallback) {
throw new \RectorPrefix20210704\Symfony\Component\Console\Exception\LogicException('A hidden question cannot use the autocompleter.');
@ -111,11 +109,9 @@ class Question
/**
* Sets whether to fallback on non-hidden question if the response can not be hidden.
*
* @param bool $fallback
*
* @return $this
*/
public function setHiddenFallback($fallback)
public function setHiddenFallback(bool $fallback)
{
$this->hiddenFallback = (bool) $fallback;
return $this;

View File

@ -74,7 +74,7 @@ interface StyleInterface
*
* @return mixed
*/
public function ask(string $question, ?string $default = null, callable $validator = null);
public function ask(string $question, string $default = null, callable $validator = null);
/**
* Asks a question with the user input hidden.
*

View File

@ -53,7 +53,7 @@ class SymfonyStyle extends \RectorPrefix20210704\Symfony\Component\Console\Style
*
* @param string|array $messages The message to write in the block
*/
public function block($messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = \false, bool $escape = \true)
public function block($messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = \false, bool $escape = \true)
{
$messages = \is_array($messages) ? \array_values($messages) : [$messages];
$this->autoPrependBlock();
@ -227,7 +227,7 @@ class SymfonyStyle extends \RectorPrefix20210704\Symfony\Component\Console\Style
/**
* {@inheritdoc}
*/
public function ask(string $question, ?string $default = null, $validator = null)
public function ask(string $question, string $default = null, callable $validator = null)
{
$question = new \RectorPrefix20210704\Symfony\Component\Console\Question\Question($question, $default);
$question->setValidator($validator);
@ -236,7 +236,7 @@ class SymfonyStyle extends \RectorPrefix20210704\Symfony\Component\Console\Style
/**
* {@inheritdoc}
*/
public function askHidden(string $question, $validator = null)
public function askHidden(string $question, callable $validator = null)
{
$question = new \RectorPrefix20210704\Symfony\Component\Console\Question\Question($question);
$question->setHidden(\true);