Updated Rector to commit c043528bfc

c043528bfc [DowngradePhp74] Skip php doc method on DowngradeContravariantArgumentTypeRector (#719)
This commit is contained in:
Tomas Votruba 2021-08-20 10:40:29 +00:00
parent c6809402a5
commit 6489f31f60
70 changed files with 328 additions and 228 deletions

View File

@ -24,8 +24,9 @@ final class CacheItem
}
/**
* @param mixed[] $properties
* @return $this
*/
public static function __set_state(array $properties) : self
public static function __set_state(array $properties)
{
return new self($properties['variableKey'], $properties['data']);
}

View File

@ -7,10 +7,11 @@ use InvalidArgumentException;
final class InvalidIndentSizeException extends \InvalidArgumentException
{
/**
* @return $this
* @param int $size
* @param int $minimumSize
*/
public static function fromSizeAndMinimumSize($size, $minimumSize) : self
public static function fromSizeAndMinimumSize($size, $minimumSize)
{
$message = \sprintf('Size %d must be greater than %d', $size, $minimumSize);
return new self($message);

View File

@ -7,9 +7,10 @@ use InvalidArgumentException;
final class InvalidIndentStringException extends \InvalidArgumentException
{
/**
* @return $this
* @param string $string
*/
public static function fromString($string) : self
public static function fromString($string)
{
$message = \sprintf('This is not valid indentation "%s"', $string);
return new self($message);

View File

@ -8,9 +8,10 @@ final class InvalidIndentStyleException extends \InvalidArgumentException
{
/**
* @param array<int, string> $allowedStyles
* @return $this
* @param string $style
*/
public static function fromStyleAndAllowedStyles($style, $allowedStyles) : self
public static function fromStyleAndAllowedStyles($style, $allowedStyles)
{
$message = \sprintf('Given style "%s" is not allowed. Allowed are "%s"', $style, \implode(' ', $allowedStyles));
return new self($message);

View File

@ -7,16 +7,18 @@ use InvalidArgumentException;
final class InvalidNewLineStringException extends \InvalidArgumentException
{
/**
* @return $this
* @param string $string
*/
public static function fromString($string) : self
public static function fromString($string)
{
return new self(\sprintf('"%s" is not a valid new-line character sequence.', $string));
}
/**
* @return $this
* @param string $message
*/
public static function create($message) : self
public static function create($message)
{
return new self($message);
}

View File

@ -7,9 +7,10 @@ use UnexpectedValueException;
final class ParseIndentException extends \UnexpectedValueException
{
/**
* @return $this
* @param string $string
*/
public static function fromString($string) : self
public static function fromString($string)
{
$message = \sprintf('The content "%s" could not be parsed', $string);
return new self($message);

View File

@ -53,9 +53,10 @@ final class Indent
return $this->string;
}
/**
* @return $this
* @param string $content
*/
public static function fromString($content) : self
public static function fromString($content)
{
$match = \RectorPrefix20210820\Nette\Utils\Strings::match($content, self::VALID_INDENT_REGEX);
if ($match === null) {
@ -64,21 +65,26 @@ final class Indent
return new self($content);
}
/**
* @return $this
* @param int $size
*/
public static function createSpaceWithSize($size) : self
public static function createSpaceWithSize($size)
{
return self::fromSizeAndStyle($size, self::SPACE);
}
public static function createTab() : self
/**
* @return $this
*/
public static function createTab()
{
return self::fromSizeAndStyle(1, self::TAB);
}
/**
* @return $this
* @param int $size
* @param string $style
*/
public static function fromSizeAndStyle($size, $style) : self
public static function fromSizeAndStyle($size, $style)
{
if ($size < self::MINIMUM_SIZE) {
throw \Rector\FileFormatter\Exception\InvalidIndentSizeException::fromSizeAndMinimumSize($size, self::MINIMUM_SIZE);
@ -90,9 +96,10 @@ final class Indent
return new self($value);
}
/**
* @return $this
* @param string $content
*/
public static function fromContent($content) : self
public static function fromContent($content)
{
$match = \RectorPrefix20210820\Nette\Utils\Strings::match($content, self::PARSE_INDENT_REGEX);
if (isset($match['indent'])) {

View File

@ -51,9 +51,10 @@ final class NewLine
return $this->string;
}
/**
* @return $this
* @param string $content
*/
public static function fromSingleCharacter($content) : self
public static function fromSingleCharacter($content)
{
$matches = \RectorPrefix20210820\Nette\Utils\Strings::match($content, self::VALID_NEWLINE_REGEX);
if ($matches === null) {
@ -62,9 +63,10 @@ final class NewLine
return new self($content);
}
/**
* @return $this
* @param string $content
*/
public static function fromContent($content) : self
public static function fromContent($content)
{
$match = \RectorPrefix20210820\Nette\Utils\Strings::match($content, self::NEWLINE_REGEX);
if (isset($match['newLine'])) {
@ -73,9 +75,10 @@ final class NewLine
return self::fromSingleCharacter(\PHP_EOL);
}
/**
* @return $this
* @param string $endOfLine
*/
public static function fromEditorConfig($endOfLine) : self
public static function fromEditorConfig($endOfLine)
{
if (!\array_key_exists($endOfLine, self::ALLOWED_END_OF_LINE)) {
$allowedEndOfLineValues = \array_keys(self::ALLOWED_END_OF_LINE);

View File

@ -31,37 +31,58 @@ final class EditorConfigConfigurationBuilder
$this->insertFinalNewline = $insertFinalNewline;
$this->newLine = \Rector\FileFormatter\ValueObject\NewLine::fromEditorConfig('lf');
}
public static function create() : self
/**
* @return $this
*/
public static function create()
{
return new self();
}
public function withNewLine(\Rector\FileFormatter\ValueObject\NewLine $newLine) : self
/**
* @return $this
*/
public function withNewLine(\Rector\FileFormatter\ValueObject\NewLine $newLine)
{
$this->newLine = $newLine;
return $this;
}
public function withIndent(\Rector\FileFormatter\ValueObject\Indent $indent) : self
/**
* @return $this
*/
public function withIndent(\Rector\FileFormatter\ValueObject\Indent $indent)
{
$this->indentSize = $indent->getIndentSize();
$this->indentStyle = $indent->getIndentStyle();
return $this;
}
public function withIndentStyle(string $indentStyle) : self
/**
* @return $this
*/
public function withIndentStyle(string $indentStyle)
{
$this->indentStyle = $indentStyle;
return $this;
}
public function withIndentSize(int $indentSize) : self
/**
* @return $this
*/
public function withIndentSize(int $indentSize)
{
$this->indentSize = $indentSize;
return $this;
}
public function withInsertFinalNewline(bool $insertFinalNewline) : self
/**
* @return $this
*/
public function withInsertFinalNewline(bool $insertFinalNewline)
{
$this->insertFinalNewline = $insertFinalNewline;
return $this;
}
public function withEndOfLineFromEditorConfig(string $endOfLine) : self
/**
* @return $this
*/
public function withEndOfLineFromEditorConfig(string $endOfLine)
{
$this->newLine = \Rector\FileFormatter\ValueObject\NewLine::fromEditorConfig($endOfLine);
return $this;

View File

@ -4,7 +4,6 @@ declare (strict_types=1);
namespace Rector\DowngradePhp80\Rector\ClassMethod;
use PhpParser\Node;
use PhpParser\Node\Name;
use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\ReflectionProvider;
@ -69,9 +68,6 @@ CODE_SAMPLE
*/
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
{
if ($node->returnType instanceof \PhpParser\Node\Name && $this->nodeNameResolver->isName($node->returnType, 'self')) {
return null;
}
$scope = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
if ($scope === null) {
$className = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CLASS_NAME);

View File

@ -12,7 +12,6 @@ use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\Property;
use PHPStan\Type\Type;
use PHPStan\Type\UnionType;
use Rector\Core\PhpParser\Comparing\NodeComparator;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\ValueObject\MethodName;
@ -21,7 +20,6 @@ use Rector\NodeTypeResolver\NodeTypeResolver;
use Rector\NodeTypeResolver\PHPStan\Type\TypeFactory;
use Rector\NodeTypeResolver\TypeComparator\TypeComparator;
use Rector\Php80\ValueObject\PropertyPromotionCandidate;
use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
use Rector\TypeDeclaration\TypeInferer\PropertyTypeInferer;
final class PromotedPropertyCandidateResolver
{
@ -172,17 +170,8 @@ final class PromotedPropertyCandidateResolver
$defaultValueType = $this->nodeTypeResolver->getStaticType($param->default);
$matchedParamType = $this->typeFactory->createMixedPassedOrUnionType([$matchedParamType, $defaultValueType]);
}
$isAllFullyQualifiedObjectType = \true;
if ($propertyType instanceof \PHPStan\Type\UnionType) {
foreach ($propertyType->getTypes() as $type) {
if (!$type instanceof \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType) {
$isAllFullyQualifiedObjectType = \false;
break;
}
}
}
// different types, not a good to fit
return !$isAllFullyQualifiedObjectType && !$this->typeComparator->areTypesEqual($propertyType, $matchedParamType);
return !$this->typeComparator->areTypesEqual($propertyType, $matchedParamType);
}
/**
* @param int[] $firstParamAsVariable

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '3c8f8a03d652d3788c91a0cd886e785cfacb959c';
public const PACKAGE_VERSION = 'c043528bfc0b5e21af7ac1b2b6b30f585695bbda';
/**
* @var string
*/
public const RELEASE_DATE = '2021-08-20 12:27:45';
public const RELEASE_DATE = '2021-08-20 12:26:29';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210820\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 ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd::getLoader();
return ComposerAutoloaderInitd3d6f9eaa113a07edcf2e5f64dc778da::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd
class ComposerAutoloaderInitd3d6f9eaa113a07edcf2e5f64dc778da
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitd3d6f9eaa113a07edcf2e5f64dc778da', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitd3d6f9eaa113a07edcf2e5f64dc778da', '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\ComposerStaticInit2131a3ddfcd6ba0077bc8936978e55fd::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitd3d6f9eaa113a07edcf2e5f64dc778da::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit2131a3ddfcd6ba0077bc8936978e55fd::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitd3d6f9eaa113a07edcf2e5f64dc778da::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire2131a3ddfcd6ba0077bc8936978e55fd($fileIdentifier, $file);
composerRequired3d6f9eaa113a07edcf2e5f64dc778da($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire2131a3ddfcd6ba0077bc8936978e55fd($fileIdentifier, $file)
function composerRequired3d6f9eaa113a07edcf2e5f64dc778da($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

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

View File

@ -14,7 +14,7 @@ interface LanguageInflectorFactory
* @return $this
* @param \Doctrine\Inflector\Rules\Ruleset|null $singularRules
*/
public function withSingularRules($singularRules, $reset = \false) : self;
public function withSingularRules($singularRules, $reset = \false);
/**
* Applies custom rules for pluralisation
*
@ -23,7 +23,7 @@ interface LanguageInflectorFactory
* @return $this
* @param \Doctrine\Inflector\Rules\Ruleset|null $pluralRules
*/
public function withPluralRules($pluralRules, $reset = \false) : self;
public function withPluralRules($pluralRules, $reset = \false);
/**
* Builds the inflector instance with all applicable rules
*/

View File

@ -59,7 +59,7 @@ class ObjectPath
* @param string $name
* @return self
*/
public function append($name) : self
public function append($name)
{
if ($name[0] === '.') {
return new self($this->absoluteName . $name, $name);

View File

@ -25,18 +25,20 @@ class ParserState
$this->context = new \RectorPrefix20210820\Helmich\TypoScriptParser\Parser\AST\RootObjectPath();
}
/**
* @return $this
* @param \Helmich\TypoScriptParser\Parser\AST\ObjectPath $context
*/
public function withContext($context) : self
public function withContext($context)
{
$clone = clone $this;
$clone->context = $context;
return $clone;
}
/**
* @return $this
* @param \ArrayObject $statements
*/
public function withStatements($statements) : self
public function withStatements($statements)
{
$clone = clone $this;
$clone->statements = $statements;

View File

@ -41,31 +41,46 @@ final class PrettyPrinterConfiguration
private function __construct()
{
}
public static function create() : self
/**
* @return $this
*/
public static function create()
{
return new self();
}
public function withTabs() : self
/**
* @return $this
*/
public function withTabs()
{
$clone = clone $this;
$clone->indentationStyle = self::INDENTATION_STYLE_TABS;
$clone->indentationSize = 1;
return $clone;
}
public function withSpaceIndentation(int $size) : self
/**
* @return $this
*/
public function withSpaceIndentation(int $size)
{
$clone = clone $this;
$clone->indentationStyle = self::INDENTATION_STYLE_SPACES;
$clone->indentationSize = $size;
return $clone;
}
public function withClosingGlobalStatement() : self
/**
* @return $this
*/
public function withClosingGlobalStatement()
{
$clone = clone $this;
$clone->addClosingGlobal = \true;
return $clone;
}
public function withEmptyLineBreaks() : self
/**
* @return $this
*/
public function withEmptyLineBreaks()
{
$clone = clone $this;
$clone->includeEmptyLineBreaks = \true;

View File

@ -16,7 +16,7 @@ class ProcessorChain implements \RectorPrefix20210820\Helmich\TypoScriptParser\T
* @param Preprocessor $next
* @return self
*/
public function with($next) : self
public function with($next)
{
$new = new self();
$new->processors = \array_merge($this->processors, [$next]);

View File

@ -88,7 +88,7 @@ abstract class Enum implements \JsonSerializable
* @param mixed $value
* @return static
*/
public static function from($value) : self
public static function from($value)
{
$key = static::assertValidValueReturningKey($value);
return self::__callStatic($key, []);

View File

@ -267,17 +267,19 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, \RectorPrefi
}
/**
* Returns an object representing HTML text.
* @return $this
* @param string $html
*/
public static function fromHtml($html) : self
public static function fromHtml($html)
{
return (new static())->setHtml($html);
}
/**
* Returns an object representing plain text.
* @return $this
* @param string $text
*/
public static function fromText($text) : self
public static function fromText($text)
{
return (new static())->setText($text);
}

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('RectorPrefix20210820\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd', false) && !interface_exists('ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd', false) && !trait_exists('ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd', false)) {
spl_autoload_call('RectorPrefix20210820\ComposerAutoloaderInit2131a3ddfcd6ba0077bc8936978e55fd');
if (!class_exists('ComposerAutoloaderInitd3d6f9eaa113a07edcf2e5f64dc778da', false) && !interface_exists('ComposerAutoloaderInitd3d6f9eaa113a07edcf2e5f64dc778da', false) && !trait_exists('ComposerAutoloaderInitd3d6f9eaa113a07edcf2e5f64dc778da', false)) {
spl_autoload_call('RectorPrefix20210820\ComposerAutoloaderInitd3d6f9eaa113a07edcf2e5f64dc778da');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20210820\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -3308,9 +3308,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210820\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire2131a3ddfcd6ba0077bc8936978e55fd')) {
function composerRequire2131a3ddfcd6ba0077bc8936978e55fd() {
return \RectorPrefix20210820\composerRequire2131a3ddfcd6ba0077bc8936978e55fd(...func_get_args());
if (!function_exists('composerRequired3d6f9eaa113a07edcf2e5f64dc778da')) {
function composerRequired3d6f9eaa113a07edcf2e5f64dc778da() {
return \RectorPrefix20210820\composerRequired3d6f9eaa113a07edcf2e5f64dc778da(...func_get_args());
}
}
if (!function_exists('parseArgs')) {

View File

@ -68,7 +68,7 @@ final class LazyCommand extends \RectorPrefix20210820\Symfony\Component\Console\
* @return $this
* @param callable $code
*/
public function setCode($code) : self
public function setCode($code)
{
$this->getCommand()->setCode($code);
return $this;
@ -84,7 +84,7 @@ final class LazyCommand extends \RectorPrefix20210820\Symfony\Component\Console\
/**
* @return $this
*/
public function setDefinition($definition) : self
public function setDefinition($definition)
{
$this->getCommand()->setDefinition($definition);
return $this;
@ -103,7 +103,7 @@ final class LazyCommand extends \RectorPrefix20210820\Symfony\Component\Console\
* @param int|null $mode
* @param string $description
*/
public function addArgument($name, $mode = null, $description = '', $default = null) : self
public function addArgument($name, $mode = null, $description = '', $default = null)
{
$this->getCommand()->addArgument($name, $mode, $description, $default);
return $this;
@ -114,7 +114,7 @@ final class LazyCommand extends \RectorPrefix20210820\Symfony\Component\Console\
* @param int|null $mode
* @param string $description
*/
public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null) : self
public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
{
$this->getCommand()->addOption($name, $shortcut, $mode, $description, $default);
return $this;
@ -123,7 +123,7 @@ final class LazyCommand extends \RectorPrefix20210820\Symfony\Component\Console\
* @return $this
* @param string $title
*/
public function setProcessTitle($title) : self
public function setProcessTitle($title)
{
$this->getCommand()->setProcessTitle($title);
return $this;
@ -132,7 +132,7 @@ final class LazyCommand extends \RectorPrefix20210820\Symfony\Component\Console\
* @return $this
* @param string $help
*/
public function setHelp($help) : self
public function setHelp($help)
{
$this->getCommand()->setHelp($help);
return $this;
@ -156,7 +156,7 @@ final class LazyCommand extends \RectorPrefix20210820\Symfony\Component\Console\
* @return $this
* @param string $usage
*/
public function addUsage($usage) : self
public function addUsage($usage)
{
$this->getCommand()->addUsage($usage);
return $this;

View File

@ -23,84 +23,118 @@ final class Cursor
$this->output = $output;
$this->input = $input ?? (\defined('STDIN') ? \STDIN : \fopen('php://input', 'r+'));
}
public function moveUp(int $lines = 1) : self
/**
* @return $this
*/
public function moveUp(int $lines = 1)
{
$this->output->write(\sprintf("\33[%dA", $lines));
return $this;
}
public function moveDown(int $lines = 1) : self
/**
* @return $this
*/
public function moveDown(int $lines = 1)
{
$this->output->write(\sprintf("\33[%dB", $lines));
return $this;
}
public function moveRight(int $columns = 1) : self
/**
* @return $this
*/
public function moveRight(int $columns = 1)
{
$this->output->write(\sprintf("\33[%dC", $columns));
return $this;
}
public function moveLeft(int $columns = 1) : self
/**
* @return $this
*/
public function moveLeft(int $columns = 1)
{
$this->output->write(\sprintf("\33[%dD", $columns));
return $this;
}
public function moveToColumn(int $column) : self
/**
* @return $this
*/
public function moveToColumn(int $column)
{
$this->output->write(\sprintf("\33[%dG", $column));
return $this;
}
public function moveToPosition(int $column, int $row) : self
/**
* @return $this
*/
public function moveToPosition(int $column, int $row)
{
$this->output->write(\sprintf("\33[%d;%dH", $row + 1, $column));
return $this;
}
public function savePosition() : self
/**
* @return $this
*/
public function savePosition()
{
$this->output->write("\0337");
return $this;
}
public function restorePosition() : self
/**
* @return $this
*/
public function restorePosition()
{
$this->output->write("\338");
return $this;
}
public function hide() : self
/**
* @return $this
*/
public function hide()
{
$this->output->write("\33[?25l");
return $this;
}
public function show() : self
/**
* @return $this
*/
public function show()
{
$this->output->write("\33[?25h\33[?0c");
return $this;
}
/**
* Clears all the output from the current line.
* @return $this
*/
public function clearLine() : self
public function clearLine()
{
$this->output->write("\33[2K");
return $this;
}
/**
* Clears all the output from the current line after the current position.
* @return $this
*/
public function clearLineAfter() : self
public function clearLineAfter()
{
$this->output->write("\33[K");
return $this;
}
/**
* Clears all the output from the cursors' current position to the end of the screen.
* @return $this
*/
public function clearOutput() : self
public function clearOutput()
{
$this->output->write("\33[0J");
return $this;
}
/**
* Clears the entire screen.
* @return $this
*/
public function clearScreen() : self
public function clearScreen()
{
$this->output->write("\33[2J");
return $this;

View File

@ -193,7 +193,7 @@ class Table
* @param int $columnIndex
* @param int $width
*/
public function setColumnMaxWidth($columnIndex, $width) : self
public function setColumnMaxWidth($columnIndex, $width)
{
if (!$this->output->getFormatter() instanceof \RectorPrefix20210820\Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface) {
throw new \LogicException(\sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', \RectorPrefix20210820\Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface::class, \get_debug_type($this->output->getFormatter())));
@ -245,8 +245,9 @@ class Table
}
/**
* Adds a row to the table, and re-renders the table.
* @return $this
*/
public function appendRow($row) : self
public function appendRow($row)
{
if (!$this->output instanceof \RectorPrefix20210820\Symfony\Component\Console\Output\ConsoleSectionOutput) {
throw new \RectorPrefix20210820\Symfony\Component\Console\Exception\RuntimeException(\sprintf('Output should be an instance of "%s" when calling "%s".', \RectorPrefix20210820\Symfony\Component\Console\Output\ConsoleSectionOutput::class, __METHOD__));
@ -267,25 +268,28 @@ class Table
return $this;
}
/**
* @return $this
* @param string|null $title
*/
public function setHeaderTitle($title) : self
public function setHeaderTitle($title)
{
$this->headerTitle = $title;
return $this;
}
/**
* @return $this
* @param string|null $title
*/
public function setFooterTitle($title) : self
public function setFooterTitle($title)
{
$this->footerTitle = $title;
return $this;
}
/**
* @return $this
* @param bool $horizontal
*/
public function setHorizontal($horizontal = \true) : self
public function setHorizontal($horizontal = \true)
{
$this->horizontal = $horizontal;
return $this;

View File

@ -81,10 +81,11 @@ class TableStyle
* 80-902734-1-6 And Then There Were None Agatha Christie
* ╚═══════════════╧══════════════════════════╧══════════════════╝
* </code>
* @return $this
* @param string $outside
* @param string|null $inside
*/
public function setHorizontalBorderChars($outside, $inside = null) : self
public function setHorizontalBorderChars($outside, $inside = null)
{
$this->horizontalOutsideBorderChar = $outside;
$this->horizontalInsideBorderChar = $inside ?? $outside;
@ -104,10 +105,11 @@ class TableStyle
* 80-902734-1-6 And Then There Were None Agatha Christie
* ╚═══════════════╧══════════════════════════╧══════════════════╝
* </code>
* @return $this
* @param string $outside
* @param string|null $inside
*/
public function setVerticalBorderChars($outside, $inside = null) : self
public function setVerticalBorderChars($outside, $inside = null)
{
$this->verticalOutsideBorderChar = $outside;
$this->verticalInsideBorderChar = $inside ?? $outside;
@ -150,8 +152,9 @@ class TableStyle
* @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null
* @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null
* @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null
* @return $this
*/
public function setCrossingChars($cross, $topLeft, $topMid, $topRight, $midRight, $bottomRight, $bottomMid, $bottomLeft, $midLeft, $topLeftBottom = null, $topMidBottom = null, $topRightBottom = null) : self
public function setCrossingChars($cross, $topLeft, $topMid, $topRight, $midRight, $bottomRight, $bottomMid, $bottomLeft, $midLeft, $topLeftBottom = null, $topMidBottom = null, $topRightBottom = null)
{
$this->crossingChar = $cross;
$this->crossingTopLeftChar = $topLeft;
@ -171,9 +174,10 @@ class TableStyle
* Sets default crossing character used for each cross.
*
* @see {@link setCrossingChars()} for setting each crossing individually.
* @return $this
* @param string $char
*/
public function setDefaultCrossingChar($char) : self
public function setDefaultCrossingChar($char)
{
return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char);
}
@ -303,9 +307,10 @@ class TableStyle
return $this->headerTitleFormat;
}
/**
* @return $this
* @param string $format
*/
public function setHeaderTitleFormat($format) : self
public function setHeaderTitleFormat($format)
{
$this->headerTitleFormat = $format;
return $this;
@ -315,9 +320,10 @@ class TableStyle
return $this->footerTitleFormat;
}
/**
* @return $this
* @param string $format
*/
public function setFooterTitleFormat($format) : self
public function setFooterTitleFormat($format)
{
$this->footerTitleFormat = $format;
return $this;

View File

@ -69,7 +69,7 @@ class Question
* @return $this
* @param bool $multiline
*/
public function setMultiline($multiline) : self
public function setMultiline($multiline)
{
$this->multiline = $multiline;
return $this;
@ -169,7 +169,7 @@ class Question
* @return $this
* @param callable|null $callback
*/
public function setAutocompleterCallback($callback = null) : self
public function setAutocompleterCallback($callback = null)
{
if ($this->hidden && null !== $callback) {
throw new \RectorPrefix20210820\Symfony\Component\Console\Exception\LogicException('A hidden question cannot use the autocompleter.');
@ -268,7 +268,7 @@ class Question
* @return $this
* @param bool $trimmable
*/
public function setTrimmable($trimmable) : self
public function setTrimmable($trimmable)
{
$this->trimmable = $trimmable;
return $this;

View File

@ -22,18 +22,20 @@ class SingleCommandApplication extends \RectorPrefix20210820\Symfony\Component\C
private $autoExit = \true;
private $running = \false;
/**
* @return $this
* @param string $version
*/
public function setVersion($version) : self
public function setVersion($version)
{
$this->version = $version;
return $this;
}
/**
* @final
* @return $this
* @param bool $autoExit
*/
public function setAutoExit($autoExit) : self
public function setAutoExit($autoExit)
{
$this->autoExit = $autoExit;
return $this;

View File

@ -154,11 +154,12 @@ class MergeExtensionConfigurationContainerBuilder extends \RectorPrefix20210820\
}
/**
* {@inheritdoc}
* @return $this
* @param \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface $pass
* @param string $type
* @param int $priority
*/
public function addCompilerPass($pass, $type = \RectorPrefix20210820\Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, $priority = 0) : self
public function addCompilerPass($pass, $type = \RectorPrefix20210820\Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, $priority = 0)
{
throw new \RectorPrefix20210820\Symfony\Component\DependencyInjection\Exception\LogicException(\sprintf('You cannot add compiler pass "%s" from extension "%s". Compiler passes must be registered before the container is compiled.', \get_debug_type($pass), $this->extensionClass));
}

View File

@ -85,7 +85,7 @@ class ContainerConfigurator extends \RectorPrefix20210820\Symfony\Component\Depe
* @return static
* @param string $path
*/
public final function withPath($path) : self
public final function withPath($path)
{
$clone = clone $this;
$clone->path = $clone->file = $path;

View File

@ -37,7 +37,7 @@ class DefaultsConfigurator extends \RectorPrefix20210820\Symfony\Component\Depen
* @param string $name
* @param mixed[] $attributes
*/
public final function tag($name, $attributes = []) : self
public final function tag($name, $attributes = [])
{
if ('' === $name) {
throw new \RectorPrefix20210820\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');

View File

@ -28,7 +28,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function __call(string $name, array $arguments) : self
public function __call(string $name, array $arguments)
{
$processor = \strtolower(\preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\\d])([A-Z])/'], 'RectorPrefix20210820\\1_\\2', $name));
$this->custom($processor, ...$arguments);
@ -38,7 +38,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
* @return $this
* @param string $processor
*/
public function custom($processor, ...$args) : self
public function custom($processor, ...$args)
{
\array_unshift($this->stack, $processor, ...$args);
return $this;
@ -46,7 +46,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function base64() : self
public function base64()
{
\array_unshift($this->stack, 'base64');
return $this;
@ -54,7 +54,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function bool() : self
public function bool()
{
\array_unshift($this->stack, 'bool');
return $this;
@ -62,7 +62,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function not() : self
public function not()
{
\array_unshift($this->stack, 'not');
return $this;
@ -70,7 +70,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function const() : self
public function const()
{
\array_unshift($this->stack, 'const');
return $this;
@ -78,7 +78,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function csv() : self
public function csv()
{
\array_unshift($this->stack, 'csv');
return $this;
@ -86,7 +86,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function file() : self
public function file()
{
\array_unshift($this->stack, 'file');
return $this;
@ -94,7 +94,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function float() : self
public function float()
{
\array_unshift($this->stack, 'float');
return $this;
@ -102,7 +102,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function int() : self
public function int()
{
\array_unshift($this->stack, 'int');
return $this;
@ -110,7 +110,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function json() : self
public function json()
{
\array_unshift($this->stack, 'json');
return $this;
@ -119,7 +119,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
* @return $this
* @param string $key
*/
public function key($key) : self
public function key($key)
{
\array_unshift($this->stack, 'key', $key);
return $this;
@ -127,7 +127,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function url() : self
public function url()
{
\array_unshift($this->stack, 'url');
return $this;
@ -135,7 +135,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function queryString() : self
public function queryString()
{
\array_unshift($this->stack, 'query_string');
return $this;
@ -143,7 +143,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function resolve() : self
public function resolve()
{
\array_unshift($this->stack, 'resolve');
return $this;
@ -152,7 +152,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
* @return $this
* @param string $fallbackParam
*/
public function default($fallbackParam) : self
public function default($fallbackParam)
{
\array_unshift($this->stack, 'default', $fallbackParam);
return $this;
@ -160,7 +160,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function string() : self
public function string()
{
\array_unshift($this->stack, 'string');
return $this;
@ -168,7 +168,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function trim() : self
public function trim()
{
\array_unshift($this->stack, 'trim');
return $this;
@ -176,7 +176,7 @@ class EnvConfigurator extends \RectorPrefix20210820\Symfony\Component\Config\Loa
/**
* @return $this
*/
public function require() : self
public function require()
{
\array_unshift($this->stack, 'require');
return $this;

View File

@ -34,9 +34,10 @@ class InstanceofConfigurator extends \RectorPrefix20210820\Symfony\Component\Dep
}
/**
* Defines an instanceof-conditional to be applied to following service definitions.
* @return $this
* @param string $fqcn
*/
public final function instanceof($fqcn) : self
public final function instanceof($fqcn)
{
return $this->parent->instanceof($fqcn);
}

View File

@ -28,7 +28,7 @@ class ParametersConfigurator extends \RectorPrefix20210820\Symfony\Component\Dep
* @return $this
* @param string $name
*/
public final function set($name, $value) : self
public final function set($name, $value)
{
$this->container->setParameter($name, static::processValue($value, \true));
return $this;
@ -38,7 +38,7 @@ class ParametersConfigurator extends \RectorPrefix20210820\Symfony\Component\Dep
*
* @return $this
*/
public final function __invoke(string $name, $value) : self
public final function __invoke(string $name, $value)
{
return $this->set($name, $value);
}

View File

@ -68,7 +68,7 @@ class PrototypeConfigurator extends \RectorPrefix20210820\Symfony\Component\Depe
*
* @return $this
*/
public final function exclude($excludes) : self
public final function exclude($excludes)
{
$this->excludes = (array) $excludes;
return $this;

View File

@ -27,7 +27,7 @@ class ReferenceConfigurator extends \RectorPrefix20210820\Symfony\Component\Depe
/**
* @return $this
*/
public final function ignoreOnInvalid() : self
public final function ignoreOnInvalid()
{
$this->invalidBehavior = \RectorPrefix20210820\Symfony\Component\DependencyInjection\ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
return $this;
@ -35,7 +35,7 @@ class ReferenceConfigurator extends \RectorPrefix20210820\Symfony\Component\Depe
/**
* @return $this
*/
public final function nullOnInvalid() : self
public final function nullOnInvalid()
{
$this->invalidBehavior = \RectorPrefix20210820\Symfony\Component\DependencyInjection\ContainerInterface::NULL_ON_INVALID_REFERENCE;
return $this;
@ -43,7 +43,7 @@ class ReferenceConfigurator extends \RectorPrefix20210820\Symfony\Component\Depe
/**
* @return $this
*/
public final function ignoreOnUninitialized() : self
public final function ignoreOnUninitialized()
{
$this->invalidBehavior = \RectorPrefix20210820\Symfony\Component\DependencyInjection\ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE;
return $this;

View File

@ -85,9 +85,10 @@ class ServicesConfigurator extends \RectorPrefix20210820\Symfony\Component\Depen
}
/**
* Removes an already defined service definition or alias.
* @return $this
* @param string $id
*/
public final function remove($id) : self
public final function remove($id)
{
$this->container->removeDefinition($id);
$this->container->removeAlias($id);

View File

@ -19,7 +19,7 @@ trait AbstractTrait
* @return $this
* @param bool $abstract
*/
public final function abstract($abstract = \true) : self
public final function abstract($abstract = \true)
{
$this->definition->setAbstract($abstract);
return $this;

View File

@ -18,7 +18,7 @@ trait ArgumentTrait
* @return $this
* @param mixed[] $arguments
*/
public final function args($arguments) : self
public final function args($arguments)
{
$this->definition->setArguments(static::processValue($arguments, \true));
return $this;
@ -31,7 +31,7 @@ trait ArgumentTrait
*
* @return $this
*/
public final function arg($key, $value) : self
public final function arg($key, $value)
{
$this->definition->setArgument($key, static::processValue($value, \true));
return $this;

View File

@ -21,7 +21,7 @@ trait AutoconfigureTrait
* @throws InvalidArgumentException when a parent is already set
* @param bool $autoconfigured
*/
public final function autoconfigure($autoconfigured = \true) : self
public final function autoconfigure($autoconfigured = \true)
{
$this->definition->setAutoconfigured($autoconfigured);
return $this;

View File

@ -18,7 +18,7 @@ trait AutowireTrait
* @return $this
* @param bool $autowired
*/
public final function autowire($autowired = \true) : self
public final function autowire($autowired = \true)
{
$this->definition->setAutowired($autowired);
return $this;

View File

@ -29,7 +29,7 @@ trait BindTrait
*
* @return $this
*/
public final function bind($nameOrFqcn, $valueOrRef) : self
public final function bind($nameOrFqcn, $valueOrRef)
{
$valueOrRef = static::processValue($valueOrRef, \true);
if (!\preg_match('/^(?:(?:array|bool|float|int|string|iterable)[ \\t]*+)?\\$/', $nameOrFqcn) && !$valueOrRef instanceof \RectorPrefix20210820\Symfony\Component\DependencyInjection\Reference) {

View File

@ -24,7 +24,7 @@ trait CallTrait
*
* @throws InvalidArgumentException on empty $method param
*/
public final function call($method, $arguments = [], $returnsClone = \false) : self
public final function call($method, $arguments = [], $returnsClone = \false)
{
$this->definition->addMethodCall($method, static::processValue($arguments, \true), $returnsClone);
return $this;

View File

@ -18,7 +18,7 @@ trait ClassTrait
* @return $this
* @param string|null $class
*/
public final function class($class) : self
public final function class($class)
{
$this->definition->setClass($class);
return $this;

View File

@ -19,7 +19,7 @@ trait ConfiguratorTrait
*
* @return $this
*/
public final function configurator($configurator) : self
public final function configurator($configurator)
{
$this->definition->setConfigurator(static::processValue($configurator, \true));
return $this;

View File

@ -26,7 +26,7 @@ trait DecorateTrait
* @param int $priority
* @param int $invalidBehavior
*/
public final function decorate($id, $renamedId = null, $priority = 0, $invalidBehavior = \RectorPrefix20210820\Symfony\Component\DependencyInjection\ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) : self
public final function decorate($id, $renamedId = null, $priority = 0, $invalidBehavior = \RectorPrefix20210820\Symfony\Component\DependencyInjection\ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
{
$this->definition->setDecoratedService($id, $renamedId, $priority, $invalidBehavior);
return $this;

View File

@ -24,7 +24,7 @@ trait DeprecateTrait
*
* @throws InvalidArgumentException when the message template is invalid
*/
public final function deprecate() : self
public final function deprecate()
{
$args = \func_get_args();
$package = $version = $message = '';

View File

@ -21,7 +21,7 @@ trait FactoryTrait
*
* @return $this
*/
public final function factory($factory) : self
public final function factory($factory)
{
if (\is_string($factory) && 1 === \substr_count($factory, ':')) {
$factoryParts = \explode(':', $factory);

View File

@ -18,7 +18,7 @@ trait FileTrait
* @return $this
* @param string $file
*/
public final function file($file) : self
public final function file($file)
{
$this->definition->setFile($file);
return $this;

View File

@ -19,7 +19,7 @@ trait LazyTrait
*
* @return $this
*/
public final function lazy($lazy = \true) : self
public final function lazy($lazy = \true)
{
$this->definition->setLazy((bool) $lazy);
if (\is_string($lazy)) {

View File

@ -22,7 +22,7 @@ trait ParentTrait
* @throws InvalidArgumentException when parent cannot be set
* @param string $parent
*/
public final function parent($parent) : self
public final function parent($parent)
{
if (!$this->allowParent) {
throw new \RectorPrefix20210820\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException(\sprintf('A parent cannot be defined when either "_instanceof" or "_defaults" are also defined for service prototype "%s".', $this->id));

View File

@ -18,7 +18,7 @@ trait PropertyTrait
* @return $this
* @param string $name
*/
public final function property($name, $value) : self
public final function property($name, $value)
{
$this->definition->setProperty($name, static::processValue($value, \true));
return $this;

View File

@ -15,7 +15,7 @@ trait PublicTrait
/**
* @return $this
*/
public final function public() : self
public final function public()
{
$this->definition->setPublic(\true);
return $this;
@ -23,7 +23,7 @@ trait PublicTrait
/**
* @return $this
*/
public final function private() : self
public final function private()
{
$this->definition->setPublic(\false);
return $this;

View File

@ -18,7 +18,7 @@ trait ShareTrait
* @return $this
* @param bool $shared
*/
public final function share($shared = \true) : self
public final function share($shared = \true)
{
$this->definition->setShared($shared);
return $this;

View File

@ -19,7 +19,7 @@ trait SyntheticTrait
* @return $this
* @param bool $synthetic
*/
public final function synthetic($synthetic = \true) : self
public final function synthetic($synthetic = \true)
{
$this->definition->setSynthetic($synthetic);
return $this;

View File

@ -20,7 +20,7 @@ trait TagTrait
* @param string $name
* @param mixed[] $attributes
*/
public final function tag($name, $attributes = []) : self
public final function tag($name, $attributes = [])
{
if ('' === $name) {
throw new \RectorPrefix20210820\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException(\sprintf('The tag name for service "%s" must be a non-empty string.', $this->id));

View File

@ -65,7 +65,7 @@ class ServiceLocator implements \RectorPrefix20210820\Symfony\Contracts\Service\
* @param string $externalId
* @param \Symfony\Component\DependencyInjection\Container $container
*/
public function withContext($externalId, $container) : self
public function withContext($externalId, $container)
{
$locator = clone $this;
$locator->externalId = $externalId;

View File

@ -72,8 +72,10 @@ class ErrorHandler
private static $exitCode = 0;
/**
* Registers the error handler.
* @param $this $handler
* @return $this
*/
public static function register(self $handler = null, bool $replace = \true) : self
public static function register($handler = null, bool $replace = \true)
{
if (null === self::$reservedMemory) {
self::$reservedMemory = \str_repeat('x', 10240);

View File

@ -52,7 +52,7 @@ class FlattenException
* @param int|null $statusCode
* @param mixed[] $headers
*/
public static function create($exception, $statusCode = null, $headers = []) : self
public static function create($exception, $statusCode = null, $headers = [])
{
return static::createFromThrowable($exception, $statusCode, $headers);
}
@ -62,7 +62,7 @@ class FlattenException
* @param int|null $statusCode
* @param mixed[] $headers
*/
public static function createFromThrowable($exception, $statusCode = null, $headers = []) : self
public static function createFromThrowable($exception, $statusCode = null, $headers = [])
{
$e = new static();
$e->setMessage($exception->getMessage());
@ -110,7 +110,7 @@ class FlattenException
* @return $this
* @param int $code
*/
public function setStatusCode($code) : self
public function setStatusCode($code)
{
$this->statusCode = $code;
return $this;
@ -123,7 +123,7 @@ class FlattenException
* @return $this
* @param mixed[] $headers
*/
public function setHeaders($headers) : self
public function setHeaders($headers)
{
$this->headers = $headers;
return $this;
@ -136,7 +136,7 @@ class FlattenException
* @return $this
* @param string $class
*/
public function setClass($class) : self
public function setClass($class)
{
$this->class = \false !== \strpos($class, "@anonymous\0") ? ((\get_parent_class($class) ?: \key(\class_implements($class))) ?: 'class') . '@anonymous' : $class;
return $this;
@ -149,7 +149,7 @@ class FlattenException
* @return $this
* @param string $file
*/
public function setFile($file) : self
public function setFile($file)
{
$this->file = $file;
return $this;
@ -162,7 +162,7 @@ class FlattenException
* @return $this
* @param int $line
*/
public function setLine($line) : self
public function setLine($line)
{
$this->line = $line;
return $this;
@ -172,9 +172,10 @@ class FlattenException
return $this->statusText;
}
/**
* @return $this
* @param string $statusText
*/
public function setStatusText($statusText) : self
public function setStatusText($statusText)
{
$this->statusText = $statusText;
return $this;
@ -187,7 +188,7 @@ class FlattenException
* @return $this
* @param string $message
*/
public function setMessage($message) : self
public function setMessage($message)
{
if (\false !== \strpos($message, "@anonymous\0")) {
$message = \preg_replace_callback('/[a-zA-Z_\\x7f-\\xff][\\\\a-zA-Z0-9_\\x7f-\\xff]*+@anonymous\\x00.*?\\.php(?:0x?|:[0-9]++\\$)[0-9a-fA-F]++/', function ($m) {
@ -209,7 +210,7 @@ class FlattenException
*
* @return $this
*/
public function setCode($code) : self
public function setCode($code)
{
$this->code = $code;
return $this;
@ -225,7 +226,7 @@ class FlattenException
* @return $this
* @param $this $previous
*/
public function setPrevious($previous) : self
public function setPrevious($previous)
{
$this->previous = $previous;
return $this;
@ -250,7 +251,7 @@ class FlattenException
* @return $this
* @param \Throwable $throwable
*/
public function setTraceFromThrowable($throwable) : self
public function setTraceFromThrowable($throwable)
{
$this->traceAsString = $throwable->getTraceAsString();
return $this->setTrace($throwable->getTrace(), $throwable->getFile(), $throwable->getLine());
@ -262,7 +263,7 @@ class FlattenException
* @param string|null $file
* @param int|null $line
*/
public function setTrace($trace, $file, $line) : self
public function setTrace($trace, $file, $line)
{
$this->trace = [];
$this->trace[] = ['namespace' => '', 'short_class' => '', 'class' => '', 'type' => '', 'function' => '', 'file' => $file, 'line' => $line, 'args' => []];
@ -324,7 +325,7 @@ class FlattenException
* @return $this
* @param string|null $asString
*/
public function setAsString($asString) : self
public function setAsString($asString)
{
$this->asString = $asString;
return $this;

View File

@ -57,7 +57,7 @@ class RegisterListenersPass implements \RectorPrefix20210820\Symfony\Component\D
* @param mixed[] $noPreloadEvents
* @param string $tagName
*/
public function setNoPreloadEvents($noPreloadEvents, $tagName = 'container.no_preload') : self
public function setNoPreloadEvents($noPreloadEvents, $tagName = 'container.no_preload')
{
$this->noPreloadEvents = \array_flip($noPreloadEvents);
$this->noPreloadTagName = $tagName;

View File

@ -55,6 +55,7 @@ class Cookie
return new static($name, $value, $data['expires'], $data['path'], $data['domain'], $data['secure'], $data['httponly'], $data['raw'], $data['samesite']);
}
/**
* @return $this
* @param string $name
* @param string|null $value
* @param string|null $path
@ -64,7 +65,7 @@ class Cookie
* @param bool $raw
* @param string|null $sameSite
*/
public static function create($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = null, $httpOnly = \true, $raw = \false, $sameSite = self::SAMESITE_LAX) : self
public static function create($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = null, $httpOnly = \true, $raw = \false, $sameSite = self::SAMESITE_LAX)
{
return new self($name, $value, $expire, $path, $domain, $secure, $httpOnly, $raw, $sameSite);
}
@ -106,7 +107,7 @@ class Cookie
* @return static
* @param string|null $value
*/
public function withValue($value) : self
public function withValue($value)
{
$cookie = clone $this;
$cookie->value = $value;
@ -118,7 +119,7 @@ class Cookie
* @return static
* @param string|null $domain
*/
public function withDomain($domain) : self
public function withDomain($domain)
{
$cookie = clone $this;
$cookie->domain = $domain;
@ -131,7 +132,7 @@ class Cookie
*
* @return static
*/
public function withExpires($expire = 0) : self
public function withExpires($expire = 0)
{
$cookie = clone $this;
$cookie->expire = self::expiresTimestamp($expire);
@ -163,7 +164,7 @@ class Cookie
* @return static
* @param string $path
*/
public function withPath($path) : self
public function withPath($path)
{
$cookie = clone $this;
$cookie->path = '' === $path ? '/' : $path;
@ -175,7 +176,7 @@ class Cookie
* @return static
* @param bool $secure
*/
public function withSecure($secure = \true) : self
public function withSecure($secure = \true)
{
$cookie = clone $this;
$cookie->secure = $secure;
@ -187,7 +188,7 @@ class Cookie
* @return static
* @param bool $httpOnly
*/
public function withHttpOnly($httpOnly = \true) : self
public function withHttpOnly($httpOnly = \true)
{
$cookie = clone $this;
$cookie->httpOnly = $httpOnly;
@ -199,7 +200,7 @@ class Cookie
* @return static
* @param bool $raw
*/
public function withRaw($raw = \true) : self
public function withRaw($raw = \true)
{
if ($raw && \false !== \strpbrk($this->name, self::$reservedCharsList)) {
throw new \InvalidArgumentException(\sprintf('The cookie name "%s" contains invalid characters.', $this->name));
@ -214,7 +215,7 @@ class Cookie
* @return static
* @param string|null $sameSite
*/
public function withSameSite($sameSite) : self
public function withSameSite($sameSite)
{
if ('' === $sameSite) {
$sameSite = null;

View File

@ -1712,7 +1712,10 @@ class Request
}
return null;
}
private static function createRequestFromFactory(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null) : self
/**
* @return $this
*/
private static function createRequestFromFactory(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
{
if (self::$requestFactory) {
$request = (self::$requestFactory)($query, $request, $attributes, $cookies, $files, $server, $content);

View File

@ -245,7 +245,7 @@ class Process implements \IteratorAggregate
* @param callable|null $callback
* @param mixed[] $env
*/
public function mustRun($callback = null, $env = []) : self
public function mustRun($callback = null, $env = [])
{
if (0 !== $this->run($callback, $env)) {
throw new \RectorPrefix20210820\Symfony\Component\Process\Exception\ProcessFailedException($this);
@ -348,7 +348,7 @@ class Process implements \IteratorAggregate
* @final
* @param mixed[] $env
*/
public function restart($callback = null, $env = []) : self
public function restart($callback = null, $env = [])
{
if ($this->isRunning()) {
throw new \RectorPrefix20210820\Symfony\Component\Process\Exception\RuntimeException('Process is already running.');

View File

@ -86,7 +86,7 @@ abstract class AbstractString implements \JsonSerializable
* @param bool $includeNeedle
* @param int $offset
*/
public function after($needle, $includeNeedle = \false, $offset = 0) : self
public function after($needle, $includeNeedle = \false, $offset = 0)
{
$str = clone $this;
$i = \PHP_INT_MAX;
@ -113,7 +113,7 @@ abstract class AbstractString implements \JsonSerializable
* @param bool $includeNeedle
* @param int $offset
*/
public function afterLast($needle, $includeNeedle = \false, $offset = 0) : self
public function afterLast($needle, $includeNeedle = \false, $offset = 0)
{
$str = clone $this;
$i = null;
@ -137,7 +137,7 @@ abstract class AbstractString implements \JsonSerializable
* @return static
* @param string ...$suffix
*/
public abstract function append(...$suffix) : self;
public abstract function append(...$suffix);
/**
* @param string|string[] $needle
*
@ -145,7 +145,7 @@ abstract class AbstractString implements \JsonSerializable
* @param bool $includeNeedle
* @param int $offset
*/
public function before($needle, $includeNeedle = \false, $offset = 0) : self
public function before($needle, $includeNeedle = \false, $offset = 0)
{
$str = clone $this;
$i = \PHP_INT_MAX;
@ -172,7 +172,7 @@ abstract class AbstractString implements \JsonSerializable
* @param bool $includeNeedle
* @param int $offset
*/
public function beforeLast($needle, $includeNeedle = \false, $offset = 0) : self
public function beforeLast($needle, $includeNeedle = \false, $offset = 0)
{
$str = clone $this;
$i = null;
@ -204,7 +204,7 @@ abstract class AbstractString implements \JsonSerializable
/**
* @return static
*/
public abstract function camel() : self;
public abstract function camel();
/**
* @return static[]
* @param int $length
@ -213,7 +213,7 @@ abstract class AbstractString implements \JsonSerializable
/**
* @return static
*/
public function collapseWhitespace() : self
public function collapseWhitespace()
{
$str = clone $this;
$str->string = \trim(\preg_replace('/(?:\\s{2,}+|[^\\S ])/', ' ', $str->string));
@ -245,7 +245,7 @@ abstract class AbstractString implements \JsonSerializable
* @return static
* @param string $suffix
*/
public function ensureEnd($suffix) : self
public function ensureEnd($suffix)
{
if (!$this->endsWith($suffix)) {
return $this->append($suffix);
@ -258,7 +258,7 @@ abstract class AbstractString implements \JsonSerializable
* @return static
* @param string $prefix
*/
public function ensureStart($prefix) : self
public function ensureStart($prefix)
{
$prefix = new static($prefix);
if (!$this->startsWith($prefix)) {
@ -290,11 +290,11 @@ abstract class AbstractString implements \JsonSerializable
/**
* @return static
*/
public abstract function folded() : self;
public abstract function folded();
/**
* @return static
*/
public function ignoreCase() : self
public function ignoreCase()
{
$str = clone $this;
$str->ignoreCase = \true;
@ -345,7 +345,7 @@ abstract class AbstractString implements \JsonSerializable
* @param mixed[] $strings
* @param string|null $lastGlue
*/
public abstract function join($strings, $lastGlue = null) : self;
public abstract function join($strings, $lastGlue = null);
public function jsonSerialize() : string
{
return $this->string;
@ -354,7 +354,7 @@ abstract class AbstractString implements \JsonSerializable
/**
* @return static
*/
public abstract function lower() : self;
public abstract function lower();
/**
* Matches the string using a regular expression.
*
@ -371,29 +371,29 @@ abstract class AbstractString implements \JsonSerializable
* @param int $length
* @param string $padStr
*/
public abstract function padBoth($length, $padStr = ' ') : self;
public abstract function padBoth($length, $padStr = ' ');
/**
* @return static
* @param int $length
* @param string $padStr
*/
public abstract function padEnd($length, $padStr = ' ') : self;
public abstract function padEnd($length, $padStr = ' ');
/**
* @return static
* @param int $length
* @param string $padStr
*/
public abstract function padStart($length, $padStr = ' ') : self;
public abstract function padStart($length, $padStr = ' ');
/**
* @return static
* @param string ...$prefix
*/
public abstract function prepend(...$prefix) : self;
public abstract function prepend(...$prefix);
/**
* @return static
* @param int $multiplier
*/
public function repeat($multiplier) : self
public function repeat($multiplier)
{
if (0 > $multiplier) {
throw new \RectorPrefix20210820\Symfony\Component\String\Exception\InvalidArgumentException(\sprintf('Multiplier must be positive, %d given.', $multiplier));
@ -407,35 +407,35 @@ abstract class AbstractString implements \JsonSerializable
* @param string $from
* @param string $to
*/
public abstract function replace($from, $to) : self;
public abstract function replace($from, $to);
/**
* @param string|callable $to
*
* @return static
* @param string $fromRegexp
*/
public abstract function replaceMatches($fromRegexp, $to) : self;
public abstract function replaceMatches($fromRegexp, $to);
/**
* @return static
*/
public abstract function reverse() : self;
public abstract function reverse();
/**
* @return static
* @param int $start
* @param int|null $length
*/
public abstract function slice($start = 0, $length = null) : self;
public abstract function slice($start = 0, $length = null);
/**
* @return static
*/
public abstract function snake() : self;
public abstract function snake();
/**
* @return static
* @param string $replacement
* @param int $start
* @param int|null $length
*/
public abstract function splice($replacement, $start = 0, $length = null) : self;
public abstract function splice($replacement, $start = 0, $length = null);
/**
* @return static[]
* @param string $delimiter
@ -499,7 +499,7 @@ abstract class AbstractString implements \JsonSerializable
* @return static
* @param bool $allWords
*/
public abstract function title($allWords = \false) : self;
public abstract function title($allWords = \false);
/**
* @param string|null $toEncoding
*/
@ -544,24 +544,24 @@ abstract class AbstractString implements \JsonSerializable
* @return static
* @param string $chars
*/
public abstract function trim($chars = " \t\n\r\0\v\f ") : self;
public abstract function trim($chars = " \t\n\r\0\v\f ");
/**
* @return static
* @param string $chars
*/
public abstract function trimEnd($chars = " \t\n\r\0\v\f ") : self;
public abstract function trimEnd($chars = " \t\n\r\0\v\f ");
/**
* @return static
* @param string $chars
*/
public abstract function trimStart($chars = " \t\n\r\0\v\f ") : self;
public abstract function trimStart($chars = " \t\n\r\0\v\f ");
/**
* @return static
* @param int $length
* @param string $ellipsis
* @param bool $cut
*/
public function truncate($length, $ellipsis = '', $cut = \true) : self
public function truncate($length, $ellipsis = '', $cut = \true)
{
$stringLength = $this->length();
if ($stringLength <= $length) {
@ -583,7 +583,7 @@ abstract class AbstractString implements \JsonSerializable
/**
* @return static
*/
public abstract function upper() : self;
public abstract function upper();
/**
* Returns the printable length on a terminal.
* @param bool $ignoreAnsiDecoration
@ -595,7 +595,7 @@ abstract class AbstractString implements \JsonSerializable
* @param string $break
* @param bool $cut
*/
public function wordwrap($width = 75, $break = "\n", $cut = \false) : self
public function wordwrap($width = 75, $break = "\n", $cut = \false)
{
$lines = '' !== $break ? $this->split($break) : [clone $this];
$chars = [];

View File

@ -46,7 +46,7 @@ abstract class AbstractUnicodeString extends \RectorPrefix20210820\Symfony\Compo
* @return static
* @param int ...$codes
*/
public static function fromCodePoints(...$codes) : self
public static function fromCodePoints(...$codes)
{
$string = '';
foreach ($codes as $code) {
@ -68,8 +68,9 @@ abstract class AbstractUnicodeString extends \RectorPrefix20210820\Symfony\Compo
* Install the intl extension for best results.
*
* @param string[]|\Transliterator[]|\Closure[] $rules See "*-Latin" rules from Transliterator::listIDs()
* @return $this
*/
public function ascii($rules = []) : self
public function ascii($rules = [])
{
$str = clone $this;
$s = $str->string;
@ -230,7 +231,7 @@ abstract class AbstractUnicodeString extends \RectorPrefix20210820\Symfony\Compo
* @return static
* @param int $form
*/
public function normalize($form = self::NFC) : self
public function normalize($form = self::NFC)
{
if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD])) {
throw new \RectorPrefix20210820\Symfony\Component\String\Exception\InvalidArgumentException('Unsupported normalization form.');

View File

@ -38,10 +38,11 @@ class ByteString extends \RectorPrefix20210820\Symfony\Component\String\Abstract
* Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/)
*/
/**
* @return $this
* @param int $length
* @param string|null $alphabet
*/
public static function fromRandom($length = 16, $alphabet = null) : self
public static function fromRandom($length = 16, $alphabet = null)
{
if ($length <= 0) {
throw new \RectorPrefix20210820\Symfony\Component\String\Exception\InvalidArgumentException(\sprintf('A strictly positive length is expected, "%d" given.', $length));

View File

@ -23,7 +23,7 @@ class LazyString implements \JsonSerializable
*
* @return static
*/
public static function fromCallable($callback, ...$arguments) : self
public static function fromCallable($callback, ...$arguments)
{
if (!\is_callable($callback) && !(\is_array($callback) && isset($callback[0]) && $callback[0] instanceof \Closure && 2 >= \count($callback))) {
throw new \TypeError(\sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, \get_debug_type($callback)));
@ -48,7 +48,7 @@ class LazyString implements \JsonSerializable
*
* @return static
*/
public static function fromStringable($value) : self
public static function fromStringable($value)
{
if (!self::isStringable($value)) {
throw new \TypeError(\sprintf('Argument 1 passed to "%s()" must be a scalar or a stringable object, "%s" given.', __METHOD__, \get_debug_type($value)));

View File

@ -24,7 +24,7 @@ class Bar
* @param \Tracy\IBarPanel $panel
* @param string|null $id
*/
public function addPanel($panel, $id = null) : self
public function addPanel($panel, $id = null)
{
if ($id === null) {
$c = 0;

View File

@ -42,7 +42,7 @@ class BlueScreen
* @return static
* @param callable $panel
*/
public function addPanel($panel) : self
public function addPanel($panel)
{
if (!\in_array($panel, $this->panels, \true)) {
$this->panels[] = $panel;
@ -54,7 +54,7 @@ class BlueScreen
* @return static
* @param callable $action
*/
public function addAction($action) : self
public function addAction($action)
{
$this->actions[] = $action;
return $this;