Updated Rector to commit 0146fc085ba712bc4d3713ef89bdb06e8e1d959f

0146fc085b bump deps
This commit is contained in:
Tomas Votruba 2022-12-29 12:31:28 +00:00
parent b6297a1113
commit e8d8146deb
11 changed files with 70 additions and 72 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '384e84a982b8535dc06e49c0ed90b1979029e0e8';
public const PACKAGE_VERSION = '0146fc085ba712bc4d3713ef89bdb06e8e1d959f';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-12-28 12:57:18';
public const RELEASE_DATE = '2022-12-29 13:25:39';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit87fe46d5f52e67c6c6f0a318acd9b01c::getLoader();
return ComposerAutoloaderInitcfcde58e4c048e6230bddd3cdfd7efb2::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit87fe46d5f52e67c6c6f0a318acd9b01c
class ComposerAutoloaderInitcfcde58e4c048e6230bddd3cdfd7efb2
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit87fe46d5f52e67c6c6f0a318acd9b01c
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit87fe46d5f52e67c6c6f0a318acd9b01c', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitcfcde58e4c048e6230bddd3cdfd7efb2', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit87fe46d5f52e67c6c6f0a318acd9b01c', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitcfcde58e4c048e6230bddd3cdfd7efb2', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit87fe46d5f52e67c6c6f0a318acd9b01c::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitcfcde58e4c048e6230bddd3cdfd7efb2::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit87fe46d5f52e67c6c6f0a318acd9b01c::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitcfcde58e4c048e6230bddd3cdfd7efb2::$files;
$requireFile = static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit87fe46d5f52e67c6c6f0a318acd9b01c
class ComposerStaticInitcfcde58e4c048e6230bddd3cdfd7efb2
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3063,9 +3063,9 @@ class ComposerStaticInit87fe46d5f52e67c6c6f0a318acd9b01c
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit87fe46d5f52e67c6c6f0a318acd9b01c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit87fe46d5f52e67c6c6f0a318acd9b01c::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit87fe46d5f52e67c6c6f0a318acd9b01c::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitcfcde58e4c048e6230bddd3cdfd7efb2::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitcfcde58e4c048e6230bddd3cdfd7efb2::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitcfcde58e4c048e6230bddd3cdfd7efb2::$classMap;
}, null, ClassLoader::class);
}

View File

@ -2339,17 +2339,17 @@
},
{
"name": "symfony\/console",
"version": "v6.2.2",
"version_normalized": "6.2.2.0",
"version": "v6.2.3",
"version_normalized": "6.2.3.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/console.git",
"reference": "5a9bd5c543f00157c55face973c149957467db31"
"reference": "0f579613e771dba2dbb8211c382342a641f5da06"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/5a9bd5c543f00157c55face973c149957467db31",
"reference": "5a9bd5c543f00157c55face973c149957467db31",
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/0f579613e771dba2dbb8211c382342a641f5da06",
"reference": "0f579613e771dba2dbb8211c382342a641f5da06",
"shasum": ""
},
"require": {
@ -2384,7 +2384,7 @@
"symfony\/lock": "",
"symfony\/process": ""
},
"time": "2022-12-16T15:08:36+00:00",
"time": "2022-12-28T14:26:22+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -2418,7 +2418,7 @@
"terminal"
],
"support": {
"source": "https:\/\/github.com\/symfony\/console\/tree\/v6.2.2"
"source": "https:\/\/github.com\/symfony\/console\/tree\/v6.2.3"
},
"funding": [
{
@ -2542,17 +2542,17 @@
},
{
"name": "symfony\/dependency-injection",
"version": "v6.1.8",
"version_normalized": "6.1.8.0",
"version": "v6.1.9",
"version_normalized": "6.1.9.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/dependency-injection.git",
"reference": "11e33ed84db0ced77511a23b35168db127909f0e"
"reference": "89db508de3ff096b2a980c7d0a5f0a2091de797b"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/dependency-injection\/zipball\/11e33ed84db0ced77511a23b35168db127909f0e",
"reference": "11e33ed84db0ced77511a23b35168db127909f0e",
"url": "https:\/\/api.github.com\/repos\/symfony\/dependency-injection\/zipball\/89db508de3ff096b2a980c7d0a5f0a2091de797b",
"reference": "89db508de3ff096b2a980c7d0a5f0a2091de797b",
"shasum": ""
},
"require": {
@ -2584,7 +2584,7 @@
"symfony\/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony\/yaml": ""
},
"time": "2022-11-25T07:34:52+00:00",
"time": "2022-12-28T14:22:24+00:00",
"type": "library",
"extra": {
"patches_applied": [
@ -2618,7 +2618,7 @@
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https:\/\/symfony.com",
"support": {
"source": "https:\/\/github.com\/symfony\/dependency-injection\/tree\/v6.1.8"
"source": "https:\/\/github.com\/symfony\/dependency-injection\/tree\/v6.1.9"
},
"funding": [
{
@ -2704,17 +2704,17 @@
},
{
"name": "symfony\/finder",
"version": "v6.2.0",
"version_normalized": "6.2.0.0",
"version": "v6.2.3",
"version_normalized": "6.2.3.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/finder.git",
"reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570"
"reference": "81eefbddfde282ee33b437ba5e13d7753211ae8e"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/finder\/zipball\/eb2355f69519e4ef33f1835bca4c935f5d42e570",
"reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570",
"url": "https:\/\/api.github.com\/repos\/symfony\/finder\/zipball\/81eefbddfde282ee33b437ba5e13d7753211ae8e",
"reference": "81eefbddfde282ee33b437ba5e13d7753211ae8e",
"shasum": ""
},
"require": {
@ -2723,7 +2723,7 @@
"require-dev": {
"symfony\/filesystem": "^6.0"
},
"time": "2022-10-09T08:55:40+00:00",
"time": "2022-12-22T17:55:15+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -2751,7 +2751,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https:\/\/symfony.com",
"support": {
"source": "https:\/\/github.com\/symfony\/finder\/tree\/v6.2.0"
"source": "https:\/\/github.com\/symfony\/finder\/tree\/v6.2.3"
},
"funding": [
{

File diff suppressed because one or more lines are too long

View File

@ -104,10 +104,6 @@ final class ProgressBar
* @var float
*/
private $percent = 0.0;
/**
* @var int
*/
private $formatLineCount;
/**
* @var mixed[]
*/
@ -450,7 +446,6 @@ final class ProgressBar
} else {
$this->format = $format;
}
$this->formatLineCount = \substr_count($this->format, "\n");
}
/**
* Overwrites a previous message to the output.
@ -464,7 +459,7 @@ final class ProgressBar
if ($this->overwrite) {
if (null !== $this->previousMessage) {
if ($this->output instanceof ConsoleSectionOutput) {
$messageLines = \explode("\n", $message);
$messageLines = \explode("\n", $this->previousMessage);
$lineCount = \count($messageLines);
foreach ($messageLines as $messageLine) {
$messageLineLength = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $messageLine));
@ -474,13 +469,11 @@ final class ProgressBar
}
$this->output->clear($lineCount);
} else {
if ('' !== $this->previousMessage) {
// only clear upper lines when last call was not a clear
for ($i = 0; $i < $this->formatLineCount; ++$i) {
$this->cursor->moveToColumn(1);
$this->cursor->clearLine();
$this->cursor->moveUp();
}
$lineCount = \substr_count($this->previousMessage, "\n");
for ($i = 0; $i < $lineCount; ++$i) {
$this->cursor->moveToColumn(1);
$this->cursor->clearLine();
$this->cursor->moveUp();
}
$this->cursor->moveToColumn(1);
$this->cursor->clearLine();

View File

@ -109,7 +109,7 @@ class ResolveInstanceofConditionalsPass implements CompilerPassInterface
foreach ($instanceofTags[$i] as $k => $v) {
if (null === $definition->getDecoratedService() || \in_array($k, $tagsToKeep, \true)) {
foreach ($v as $v) {
if ($definition->hasTag($k) && (!$v || \in_array($v, $definition->getTag($k)))) {
if ($definition->hasTag($k) && \in_array($v, $definition->getTag($k))) {
continue;
}
$definition->addTag($k, $v);

View File

@ -435,8 +435,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
public function get(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) : ?object
{
if ($this->isCompiled() && isset($this->removedIds[$id]) && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE >= $invalidBehavior) {
return parent::get($id);
if ($this->isCompiled() && isset($this->removedIds[$id])) {
return ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE >= $invalidBehavior ? parent::get($id) : null;
}
return $this->doGet($id, $invalidBehavior);
}
@ -454,9 +454,9 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
}
try {
if (ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $invalidBehavior) {
return parent::get($id, $invalidBehavior);
return $this->privates[$id] ?? parent::get($id, $invalidBehavior);
}
if ($service = parent::get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)) {
if (null !== ($service = $this->privates[$id] ?? parent::get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE))) {
return $service;
}
} catch (ServiceCircularReferenceException $e) {
@ -878,8 +878,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
}
}
$arguments = $this->doResolveServices($parameterBag->unescapeValue($parameterBag->resolveValue($arguments)), $inlineServices, $isConstructorArgument);
if (null !== $id && $definition->isShared() && isset($this->services[$id]) && ($tryProxy || !$definition->isLazy())) {
return $this->services[$id];
if (null !== $id && $definition->isShared() && (isset($this->services[$id]) || isset($this->privates[$id])) && ($tryProxy || !$definition->isLazy())) {
return $this->services[$id] ?? $this->privates[$id];
}
if (null !== $factory) {
$service = $factory(...$arguments);
@ -1372,7 +1372,11 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
{
$inlineServices[$id ?? \spl_object_hash($definition)] = $service;
if (null !== $id && $definition->isShared()) {
$this->services[$id] = $service;
if ($definition->isPrivate() && $this->isCompiled()) {
$this->privates[$id] = $service;
} else {
$this->services[$id] = $service;
}
unset($this->loading[$id]);
}
}

View File

@ -31,7 +31,7 @@ use RectorPrefix202212\Symfony\Component\DependencyInjection\Exception\LogicExce
use RectorPrefix202212\Symfony\Component\DependencyInjection\Exception\RuntimeException;
use RectorPrefix202212\Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
use RectorPrefix202212\Symfony\Component\DependencyInjection\ExpressionLanguage;
use RectorPrefix202212\Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface as ProxyDumper;
use RectorPrefix202212\Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface;
use RectorPrefix202212\Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper;
use RectorPrefix202212\Symfony\Component\DependencyInjection\Loader\FileLoader;
use RectorPrefix202212\Symfony\Component\DependencyInjection\Parameter;
@ -165,9 +165,13 @@ class PhpDumper extends Dumper
*/
private $baseClass;
/**
* @var ProxyDumper
* @var \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface
*/
private $proxyDumper;
/**
* @var bool
*/
private $hasProxyDumper = \false;
/**
* {@inheritdoc}
*/
@ -181,9 +185,10 @@ class PhpDumper extends Dumper
/**
* Sets the dumper to be used when dumping proxies in the generated container.
*/
public function setProxyDumper(ProxyDumper $proxyDumper)
public function setProxyDumper(DumperInterface $proxyDumper)
{
$this->proxyDumper = $proxyDumper;
$this->hasProxyDumper = !$proxyDumper instanceof NullDumper;
}
/**
* Dumps the service container as a PHP class.
@ -223,7 +228,7 @@ class PhpDumper extends Dumper
$this->baseClass = $baseClass;
}
$this->initializeMethodNamesMap('Container' === $baseClass ? Container::class : $baseClass);
if ($this->getProxyDumper() instanceof NullDumper) {
if (!$this->hasProxyDumper) {
(new AnalyzeServiceReferencesPass(\true, \false))->process($this->container);
try {
(new CheckCircularReferencesPass())->process($this->container);
@ -414,13 +419,13 @@ EOF;
/**
* Retrieves the currently set proxy dumper or instantiates one.
*/
private function getProxyDumper() : ProxyDumper
private function getProxyDumper() : DumperInterface
{
return $this->proxyDumper = $this->proxyDumper ?? new NullDumper();
}
private function analyzeReferences()
{
(new AnalyzeServiceReferencesPass(\false, !$this->getProxyDumper() instanceof NullDumper))->process($this->container);
(new AnalyzeServiceReferencesPass(\false, $this->hasProxyDumper))->process($this->container);
$checkedNodes = [];
$this->circularReferences = [];
$this->singleUsePrivateIds = [];
@ -443,12 +448,12 @@ EOF;
foreach ($edges as $edge) {
$node = $edge->getDestNode();
$id = $node->getId();
if ($sourceId === $id || !$node->getValue() instanceof Definition || $edge->isLazy() || $edge->isWeak()) {
if ($sourceId === $id || !$node->getValue() instanceof Definition || $edge->isWeak()) {
continue;
}
if (isset($path[$id])) {
$loop = null;
$loopByConstructor = $edge->isReferencedByConstructor();
$loopByConstructor = $edge->isReferencedByConstructor() && !$edge->isLazy();
$pathInLoop = [$id, []];
foreach ($path as $k => $pathByConstructor) {
if (null !== $loop) {
@ -462,7 +467,7 @@ EOF;
}
$this->addCircularReferences($id, $loop, $loopByConstructor);
} elseif (!isset($checkedNodes[$id])) {
$this->collectCircularReferences($id, $node->getOutEdges(), $checkedNodes, $loops, $path, $edge->isReferencedByConstructor());
$this->collectCircularReferences($id, $node->getOutEdges(), $checkedNodes, $loops, $path, $edge->isReferencedByConstructor() && !$edge->isLazy());
} elseif (isset($loops[$id])) {
// we already had detected loops for this edge
// let's check if we have a common ancestor in one of the detected loops
@ -482,7 +487,7 @@ EOF;
}
// we can now build the loop
$loop = null;
$loopByConstructor = $edge->isReferencedByConstructor();
$loopByConstructor = $edge->isReferencedByConstructor() && !$edge->isLazy();
foreach ($fillPath as $k => $pathByConstructor) {
if (null !== $loop) {
$loop[] = $k;
@ -897,7 +902,7 @@ EOF;
if ($this->container->hasDefinition($targetId) && ($def = $this->container->getDefinition($targetId)) && !$def->isShared()) {
return '';
}
$hasSelfRef = isset($this->circularReferences[$id][$targetId]) && !isset($this->definitionVariables[$definition]);
$hasSelfRef = isset($this->circularReferences[$id][$targetId]) && !isset($this->definitionVariables[$definition]) && !($this->hasProxyDumper && $definition->isLazy());
if ($hasSelfRef && !$forConstructor && !($forConstructor = !$this->circularReferences[$id][$targetId])) {
$code = $this->addInlineService($id, $definition, $definition);
} else {
@ -928,7 +933,7 @@ EOTXT
$code = '';
if ($isSimpleInstance = $isRootInstance = null === $inlineDef) {
foreach ($this->serviceCalls as $targetId => [$callCount, $behavior, $byConstructor]) {
if ($byConstructor && isset($this->circularReferences[$id][$targetId]) && !$this->circularReferences[$id][$targetId]) {
if ($byConstructor && isset($this->circularReferences[$id][$targetId]) && !$this->circularReferences[$id][$targetId] && !($this->hasProxyDumper && $definition->isLazy())) {
$code .= $this->addInlineReference($id, $definition, $targetId, $forConstructor);
}
}

View File

@ -67,16 +67,12 @@ final class ReverseContainer
*/
public function getService(string $id) : object
{
if ($this->serviceContainer->has($id)) {
return $this->serviceContainer->get($id);
}
if ($this->reversibleLocator->has($id)) {
return $this->reversibleLocator->get($id);
}
if (isset($this->serviceContainer->getRemovedIds()[$id])) {
throw new ServiceNotFoundException($id, null, null, [], \sprintf('The "%s" service is private and cannot be accessed by reference. You should either make it public, or tag it as "%s".', $id, $this->tagName));
}
// will throw a ServiceNotFoundException
$this->serviceContainer->get($id);
return $this->serviceContainer->get($id);
}
}