Skip to content

Commit

Permalink
Updated Rector to commit c9f4b4f843cef6757e6da1de8fb2a6f08987bced
Browse files Browse the repository at this point in the history
rectorphp/rector-src@c9f4b4f bump to laravel illuminate/container: ^11.22.0 (#6296)
  • Loading branch information
TomasVotruba committed Sep 7, 2024
1 parent 4cbb79d commit 9011953
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 48 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'feaf6eae6b9a765fe229d65a9ba07c5715649dee';
public const PACKAGE_VERSION = 'c9f4b4f843cef6757e6da1de8fb2a6f08987bced';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-09-06 14:09:11';
public const RELEASE_DATE = '2024-09-07 23:56:00';
/**
* @var int
*/
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit71df4959ab5d17cc3273dd40c295b701::getLoader();
return ComposerAutoloaderInit8271306f0ebaff89706816bb96249bfb::getLoader();
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit71df4959ab5d17cc3273dd40c295b701
class ComposerAutoloaderInit8271306f0ebaff89706816bb96249bfb
{
private static $loader;

Expand All @@ -22,17 +22,17 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit71df4959ab5d17cc3273dd40c295b701', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit8271306f0ebaff89706816bb96249bfb', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit71df4959ab5d17cc3273dd40c295b701', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit8271306f0ebaff89706816bb96249bfb', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit71df4959ab5d17cc3273dd40c295b701::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit8271306f0ebaff89706816bb96249bfb::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);

$filesToLoad = \Composer\Autoload\ComposerStaticInit71df4959ab5d17cc3273dd40c295b701::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit8271306f0ebaff89706816bb96249bfb::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit71df4959ab5d17cc3273dd40c295b701
class ComposerStaticInit8271306f0ebaff89706816bb96249bfb
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -2792,9 +2792,9 @@ class ComposerStaticInit71df4959ab5d17cc3273dd40c295b701
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit71df4959ab5d17cc3273dd40c295b701::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit71df4959ab5d17cc3273dd40c295b701::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit71df4959ab5d17cc3273dd40c295b701::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit8271306f0ebaff89706816bb96249bfb::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8271306f0ebaff89706816bb96249bfb::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8271306f0ebaff89706816bb96249bfb::$classMap;

}, null, ClassLoader::class);
}
Expand Down
26 changes: 13 additions & 13 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -512,17 +512,17 @@
},
{
"name": "illuminate\/container",
"version": "v11.20.0",
"version_normalized": "11.20.0.0",
"version": "v11.22.0",
"version_normalized": "11.22.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/container.git",
"reference": "f47be671981a4438257c4fbfc3ad257f4e3e929a"
"reference": "85e3396fde3139eae3f37128222c9a7746ca4bbb"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/f47be671981a4438257c4fbfc3ad257f4e3e929a",
"reference": "f47be671981a4438257c4fbfc3ad257f4e3e929a",
"url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/85e3396fde3139eae3f37128222c9a7746ca4bbb",
"reference": "85e3396fde3139eae3f37128222c9a7746ca4bbb",
"shasum": ""
},
"require": {
Expand All @@ -533,7 +533,7 @@
"provide": {
"psr\/container-implementation": "1.1|2.0"
},
"time": "2024-08-05T15:04:01+00:00",
"time": "2024-08-21T16:01:30+00:00",
"type": "library",
"extra": {
"branch-alias": {
Expand Down Expand Up @@ -867,17 +867,17 @@
},
{
"name": "phpstan\/phpdoc-parser",
"version": "1.30.0",
"version_normalized": "1.30.0.0",
"version": "1.30.1",
"version_normalized": "1.30.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpdoc-parser.git",
"reference": "5ceb0e384997db59f38774bf79c2a6134252c08f"
"reference": "51b95ec8670af41009e2b2b56873bad96682413e"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/5ceb0e384997db59f38774bf79c2a6134252c08f",
"reference": "5ceb0e384997db59f38774bf79c2a6134252c08f",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/51b95ec8670af41009e2b2b56873bad96682413e",
"reference": "51b95ec8670af41009e2b2b56873bad96682413e",
"shasum": ""
},
"require": {
Expand All @@ -894,7 +894,7 @@
"phpunit\/phpunit": "^9.5",
"symfony\/process": "^5.2"
},
"time": "2024-08-29T09:54:52+00:00",
"time": "2024-09-07T20:13:05+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand All @@ -911,7 +911,7 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https:\/\/github.com\/phpstan\/phpdoc-parser\/issues",
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.30.0"
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.30.1"
},
"install-path": "..\/phpstan\/phpdoc-parser"
},
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.php

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions vendor/illuminate/container/BoundMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,25 +137,32 @@ protected static function getCallReflector($callback)
*/
protected static function addDependencyForCallParameter($container, $parameter, array &$parameters, &$dependencies)
{
$pendingDependencies = [];
if (\array_key_exists($paramName = $parameter->getName(), $parameters)) {
$dependencies[] = $parameters[$paramName];
$pendingDependencies[] = $parameters[$paramName];
unset($parameters[$paramName]);
} elseif ($attribute = Util::getContextualAttributeFromDependency($parameter)) {
$pendingDependencies[] = $container->resolveFromAttribute($attribute);
} elseif (!\is_null($className = Util::getParameterClassName($parameter))) {
if (\array_key_exists($className, $parameters)) {
$dependencies[] = $parameters[$className];
$pendingDependencies[] = $parameters[$className];
unset($parameters[$className]);
} elseif ($parameter->isVariadic()) {
$variadicDependencies = $container->make($className);
$dependencies = \array_merge($dependencies, \is_array($variadicDependencies) ? $variadicDependencies : [$variadicDependencies]);
$pendingDependencies = \array_merge($pendingDependencies, \is_array($variadicDependencies) ? $variadicDependencies : [$variadicDependencies]);
} else {
$dependencies[] = $container->make($className);
$pendingDependencies[] = $container->make($className);
}
} elseif ($parameter->isDefaultValueAvailable()) {
$dependencies[] = $parameter->getDefaultValue();
$pendingDependencies[] = $parameter->getDefaultValue();
} elseif (!$parameter->isOptional() && !\array_key_exists($paramName, $parameters)) {
$message = "Unable to resolve dependency [{$parameter}] in class {$parameter->getDeclaringClass()->getName()}";
throw new BindingResolutionException($message);
}
foreach ($pendingDependencies as $dependency) {
$container->fireAfterResolvingAttributeCallbacks(\method_exists($parameter, 'getAttributes') ? $parameter->getAttributes() : [], $dependency);
}
$dependencies = \array_merge($dependencies, $pendingDependencies);
}
/**
* Determine if the given string is in Class@method syntax.
Expand Down
16 changes: 3 additions & 13 deletions vendor/illuminate/container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ protected function resolveDependencies(array $dependencies)
continue;
}
$result = null;
if (!\is_null($attribute = $this->getContextualAttributeFromDependency($dependency))) {
if (!\is_null($attribute = Util::getContextualAttributeFromDependency($dependency))) {
$result = $this->resolveFromAttribute($attribute);
}
// If the class is null, it means the dependency is a string or some other
Expand Down Expand Up @@ -908,16 +908,6 @@ protected function getLastParameterOverride()
{
return \count($this->with) ? \end($this->with) : [];
}
/**
* Get a contextual attribute from a dependency.
*
* @param ReflectionParameter $dependency
* @return \ReflectionAttribute|null
*/
protected function getContextualAttributeFromDependency($dependency)
{
return (\method_exists($dependency, 'getAttributes') ? $dependency->getAttributes(ContextualAttribute::class, ReflectionAttribute::IS_INSTANCEOF) : [])[0] ?? null;
}
/**
* Resolve a non-class hinted primitive dependency.
*
Expand Down Expand Up @@ -986,7 +976,7 @@ protected function resolveVariadicClass(ReflectionParameter $parameter)
* @param \ReflectionAttribute $attribute
* @return mixed
*/
protected function resolveFromAttribute(ReflectionAttribute $attribute)
public function resolveFromAttribute(ReflectionAttribute $attribute)
{
$handler = $this->contextualAttributes[$attribute->getName()] ?? null;
$instance = $attribute->newInstance();
Expand Down Expand Up @@ -1156,7 +1146,7 @@ protected function fireAfterResolvingCallbacks($abstract, $object)
* @param mixed $object
* @return void
*/
protected function fireAfterResolvingAttributeCallbacks(array $attributes, $object)
public function fireAfterResolvingAttributeCallbacks(array $attributes, $object)
{
foreach ($attributes as $attribute) {
if (\is_a($attribute->getName(), ContextualAttribute::class, \true)) {
Expand Down
12 changes: 12 additions & 0 deletions vendor/illuminate/container/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace RectorPrefix202409\Illuminate\Container;

use Closure;
use RectorPrefix202409\Illuminate\Contracts\Container\ContextualAttribute;
use ReflectionAttribute;
use ReflectionNamedType;
/**
* @internal
Expand Down Expand Up @@ -62,4 +64,14 @@ public static function getParameterClassName($parameter)
}
return $name;
}
/**
* Get a contextual attribute from a dependency.
*
* @param \ReflectionParameter $dependency
* @return \ReflectionAttribute|null
*/
public static function getContextualAttributeFromDependency($dependency)
{
return (\method_exists($dependency, 'getAttributes') ? $dependency->getAttributes(ContextualAttribute::class, ReflectionAttribute::IS_INSTANCEOF) : [])[0] ?? null;
}
}
2 changes: 1 addition & 1 deletion vendor/phpstan/phpdoc-parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For the complete list of supported PHPDoc features check out PHPStan documentati

* [PHPDoc Basics](https://phpstan.org/writing-php-code/phpdocs-basics) (list of PHPDoc tags)
* [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types) (list of PHPDoc types)
* [phpdoc-parser API Reference](https://phpstan.github.io/phpdoc-parser/namespace-PHPStan.PhpDocParser.html) with all the AST node types etc.
* [phpdoc-parser API Reference](https://phpstan.github.io/phpdoc-parser/1.23.x/namespace-PHPStan.PhpDocParser.html) with all the AST node types etc.

This parser also supports parsing [Doctrine Annotations](https://github.com/doctrine/annotations). The AST nodes live in the [PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine namespace](https://phpstan.github.io/phpdoc-parser/namespace-PHPStan.PhpDocParser.Ast.PhpDoc.Doctrine.html). The support needs to be turned on by setting `bool $parseDoctrineAnnotations` to `true` in `Lexer` and `PhpDocParser` class constructors.

Expand Down
4 changes: 2 additions & 2 deletions vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private function parseText(\PHPStan\PhpDocParser\Parser\TokenIterator $tokens) :
$tmpText = $tokens->getSkippedHorizontalWhiteSpaceIfAny() . $tokens->joinUntil(Lexer::TOKEN_PHPDOC_EOL, ...$endTokens);
$text .= $tmpText;
// stop if we're not at EOL - meaning it's the end of PHPDoc
if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) {
if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC)) {
break;
}
if ($this->textBetweenTagsBelongsToDescription) {
Expand Down Expand Up @@ -209,7 +209,7 @@ private function parseOptionalDescriptionAfterDoctrineTag(\PHPStan\PhpDocParser\
$tmpText = $tokens->getSkippedHorizontalWhiteSpaceIfAny() . $tokens->joinUntil(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_DOCTRINE_TAG, Lexer::TOKEN_PHPDOC_EOL, ...$endTokens);
$text .= $tmpText;
// stop if we're not at EOL - meaning it's the end of PHPDoc
if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) {
if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC)) {
if (!$tokens->isPrecededByHorizontalWhitespace()) {
return trim($text . $this->parseText($tokens)->text, " \t");
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/scoper-autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function humbug_phpscoper_expose_class($exposed, $prefixed) {
}
}
humbug_phpscoper_expose_class('AutoloadIncluder', 'RectorPrefix202409\AutoloadIncluder');
humbug_phpscoper_expose_class('ComposerAutoloaderInit71df4959ab5d17cc3273dd40c295b701', 'RectorPrefix202409\ComposerAutoloaderInit71df4959ab5d17cc3273dd40c295b701');
humbug_phpscoper_expose_class('ComposerAutoloaderInit8271306f0ebaff89706816bb96249bfb', 'RectorPrefix202409\ComposerAutoloaderInit8271306f0ebaff89706816bb96249bfb');
humbug_phpscoper_expose_class('Product', 'RectorPrefix202409\Product');

// Function aliases. For more information see:
Expand Down

0 comments on commit 9011953

Please sign in to comment.