Skip to content

Commit 9011953

Browse files
committed
Updated Rector to commit c9f4b4f843cef6757e6da1de8fb2a6f08987bced
rectorphp/rector-src@c9f4b4f bump to laravel illuminate/container: ^11.22.0 (#6296)
1 parent 4cbb79d commit 9011953

File tree

12 files changed

+57
-48
lines changed

12 files changed

+57
-48
lines changed

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'feaf6eae6b9a765fe229d65a9ba07c5715649dee';
22+
public const PACKAGE_VERSION = 'c9f4b4f843cef6757e6da1de8fb2a6f08987bced';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2024-09-06 14:09:11';
27+
public const RELEASE_DATE = '2024-09-07 23:56:00';
2828
/**
2929
* @var int
3030
*/

vendor/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

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

25-
return ComposerAutoloaderInit71df4959ab5d17cc3273dd40c295b701::getLoader();
25+
return ComposerAutoloaderInit8271306f0ebaff89706816bb96249bfb::getLoader();

vendor/composer/autoload_real.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_real.php @generated by Composer
44

5-
class ComposerAutoloaderInit71df4959ab5d17cc3273dd40c295b701
5+
class ComposerAutoloaderInit8271306f0ebaff89706816bb96249bfb
66
{
77
private static $loader;
88

@@ -22,17 +22,17 @@ public static function getLoader()
2222
return self::$loader;
2323
}
2424

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

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

3232
$loader->setClassMapAuthoritative(true);
3333
$loader->register(true);
3434

35-
$filesToLoad = \Composer\Autoload\ComposerStaticInit71df4959ab5d17cc3273dd40c295b701::$files;
35+
$filesToLoad = \Composer\Autoload\ComposerStaticInit8271306f0ebaff89706816bb96249bfb::$files;
3636
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
3737
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
3838
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

vendor/composer/autoload_static.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Composer\Autoload;
66

7-
class ComposerStaticInit71df4959ab5d17cc3273dd40c295b701
7+
class ComposerStaticInit8271306f0ebaff89706816bb96249bfb
88
{
99
public static $files = array (
1010
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@@ -2792,9 +2792,9 @@ class ComposerStaticInit71df4959ab5d17cc3273dd40c295b701
27922792
public static function getInitializer(ClassLoader $loader)
27932793
{
27942794
return \Closure::bind(function () use ($loader) {
2795-
$loader->prefixLengthsPsr4 = ComposerStaticInit71df4959ab5d17cc3273dd40c295b701::$prefixLengthsPsr4;
2796-
$loader->prefixDirsPsr4 = ComposerStaticInit71df4959ab5d17cc3273dd40c295b701::$prefixDirsPsr4;
2797-
$loader->classMap = ComposerStaticInit71df4959ab5d17cc3273dd40c295b701::$classMap;
2795+
$loader->prefixLengthsPsr4 = ComposerStaticInit8271306f0ebaff89706816bb96249bfb::$prefixLengthsPsr4;
2796+
$loader->prefixDirsPsr4 = ComposerStaticInit8271306f0ebaff89706816bb96249bfb::$prefixDirsPsr4;
2797+
$loader->classMap = ComposerStaticInit8271306f0ebaff89706816bb96249bfb::$classMap;
27982798

27992799
}, null, ClassLoader::class);
28002800
}

vendor/composer/installed.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -512,17 +512,17 @@
512512
},
513513
{
514514
"name": "illuminate\/container",
515-
"version": "v11.20.0",
516-
"version_normalized": "11.20.0.0",
515+
"version": "v11.22.0",
516+
"version_normalized": "11.22.0.0",
517517
"source": {
518518
"type": "git",
519519
"url": "https:\/\/github.com\/illuminate\/container.git",
520-
"reference": "f47be671981a4438257c4fbfc3ad257f4e3e929a"
520+
"reference": "85e3396fde3139eae3f37128222c9a7746ca4bbb"
521521
},
522522
"dist": {
523523
"type": "zip",
524-
"url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/f47be671981a4438257c4fbfc3ad257f4e3e929a",
525-
"reference": "f47be671981a4438257c4fbfc3ad257f4e3e929a",
524+
"url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/85e3396fde3139eae3f37128222c9a7746ca4bbb",
525+
"reference": "85e3396fde3139eae3f37128222c9a7746ca4bbb",
526526
"shasum": ""
527527
},
528528
"require": {
@@ -533,7 +533,7 @@
533533
"provide": {
534534
"psr\/container-implementation": "1.1|2.0"
535535
},
536-
"time": "2024-08-05T15:04:01+00:00",
536+
"time": "2024-08-21T16:01:30+00:00",
537537
"type": "library",
538538
"extra": {
539539
"branch-alias": {
@@ -867,17 +867,17 @@
867867
},
868868
{
869869
"name": "phpstan\/phpdoc-parser",
870-
"version": "1.30.0",
871-
"version_normalized": "1.30.0.0",
870+
"version": "1.30.1",
871+
"version_normalized": "1.30.1.0",
872872
"source": {
873873
"type": "git",
874874
"url": "https:\/\/github.com\/phpstan\/phpdoc-parser.git",
875-
"reference": "5ceb0e384997db59f38774bf79c2a6134252c08f"
875+
"reference": "51b95ec8670af41009e2b2b56873bad96682413e"
876876
},
877877
"dist": {
878878
"type": "zip",
879-
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/5ceb0e384997db59f38774bf79c2a6134252c08f",
880-
"reference": "5ceb0e384997db59f38774bf79c2a6134252c08f",
879+
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/51b95ec8670af41009e2b2b56873bad96682413e",
880+
"reference": "51b95ec8670af41009e2b2b56873bad96682413e",
881881
"shasum": ""
882882
},
883883
"require": {
@@ -894,7 +894,7 @@
894894
"phpunit\/phpunit": "^9.5",
895895
"symfony\/process": "^5.2"
896896
},
897-
"time": "2024-08-29T09:54:52+00:00",
897+
"time": "2024-09-07T20:13:05+00:00",
898898
"type": "library",
899899
"installation-source": "dist",
900900
"autoload": {
@@ -911,7 +911,7 @@
911911
"description": "PHPDoc parser with support for nullable, intersection and generic types",
912912
"support": {
913913
"issues": "https:\/\/github.com\/phpstan\/phpdoc-parser\/issues",
914-
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.30.0"
914+
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.30.1"
915915
},
916916
"install-path": "..\/phpstan\/phpdoc-parser"
917917
},

vendor/composer/installed.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

vendor/illuminate/container/BoundMethod.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,25 +137,32 @@ protected static function getCallReflector($callback)
137137
*/
138138
protected static function addDependencyForCallParameter($container, $parameter, array &$parameters, &$dependencies)
139139
{
140+
$pendingDependencies = [];
140141
if (\array_key_exists($paramName = $parameter->getName(), $parameters)) {
141-
$dependencies[] = $parameters[$paramName];
142+
$pendingDependencies[] = $parameters[$paramName];
142143
unset($parameters[$paramName]);
144+
} elseif ($attribute = Util::getContextualAttributeFromDependency($parameter)) {
145+
$pendingDependencies[] = $container->resolveFromAttribute($attribute);
143146
} elseif (!\is_null($className = Util::getParameterClassName($parameter))) {
144147
if (\array_key_exists($className, $parameters)) {
145-
$dependencies[] = $parameters[$className];
148+
$pendingDependencies[] = $parameters[$className];
146149
unset($parameters[$className]);
147150
} elseif ($parameter->isVariadic()) {
148151
$variadicDependencies = $container->make($className);
149-
$dependencies = \array_merge($dependencies, \is_array($variadicDependencies) ? $variadicDependencies : [$variadicDependencies]);
152+
$pendingDependencies = \array_merge($pendingDependencies, \is_array($variadicDependencies) ? $variadicDependencies : [$variadicDependencies]);
150153
} else {
151-
$dependencies[] = $container->make($className);
154+
$pendingDependencies[] = $container->make($className);
152155
}
153156
} elseif ($parameter->isDefaultValueAvailable()) {
154-
$dependencies[] = $parameter->getDefaultValue();
157+
$pendingDependencies[] = $parameter->getDefaultValue();
155158
} elseif (!$parameter->isOptional() && !\array_key_exists($paramName, $parameters)) {
156159
$message = "Unable to resolve dependency [{$parameter}] in class {$parameter->getDeclaringClass()->getName()}";
157160
throw new BindingResolutionException($message);
158161
}
162+
foreach ($pendingDependencies as $dependency) {
163+
$container->fireAfterResolvingAttributeCallbacks(\method_exists($parameter, 'getAttributes') ? $parameter->getAttributes() : [], $dependency);
164+
}
165+
$dependencies = \array_merge($dependencies, $pendingDependencies);
159166
}
160167
/**
161168
* Determine if the given string is in Class@method syntax.

vendor/illuminate/container/Container.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ protected function resolveDependencies(array $dependencies)
863863
continue;
864864
}
865865
$result = null;
866-
if (!\is_null($attribute = $this->getContextualAttributeFromDependency($dependency))) {
866+
if (!\is_null($attribute = Util::getContextualAttributeFromDependency($dependency))) {
867867
$result = $this->resolveFromAttribute($attribute);
868868
}
869869
// If the class is null, it means the dependency is a string or some other
@@ -908,16 +908,6 @@ protected function getLastParameterOverride()
908908
{
909909
return \count($this->with) ? \end($this->with) : [];
910910
}
911-
/**
912-
* Get a contextual attribute from a dependency.
913-
*
914-
* @param ReflectionParameter $dependency
915-
* @return \ReflectionAttribute|null
916-
*/
917-
protected function getContextualAttributeFromDependency($dependency)
918-
{
919-
return (\method_exists($dependency, 'getAttributes') ? $dependency->getAttributes(ContextualAttribute::class, ReflectionAttribute::IS_INSTANCEOF) : [])[0] ?? null;
920-
}
921911
/**
922912
* Resolve a non-class hinted primitive dependency.
923913
*
@@ -986,7 +976,7 @@ protected function resolveVariadicClass(ReflectionParameter $parameter)
986976
* @param \ReflectionAttribute $attribute
987977
* @return mixed
988978
*/
989-
protected function resolveFromAttribute(ReflectionAttribute $attribute)
979+
public function resolveFromAttribute(ReflectionAttribute $attribute)
990980
{
991981
$handler = $this->contextualAttributes[$attribute->getName()] ?? null;
992982
$instance = $attribute->newInstance();
@@ -1156,7 +1146,7 @@ protected function fireAfterResolvingCallbacks($abstract, $object)
11561146
* @param mixed $object
11571147
* @return void
11581148
*/
1159-
protected function fireAfterResolvingAttributeCallbacks(array $attributes, $object)
1149+
public function fireAfterResolvingAttributeCallbacks(array $attributes, $object)
11601150
{
11611151
foreach ($attributes as $attribute) {
11621152
if (\is_a($attribute->getName(), ContextualAttribute::class, \true)) {

vendor/illuminate/container/Util.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace RectorPrefix202409\Illuminate\Container;
44

55
use Closure;
6+
use RectorPrefix202409\Illuminate\Contracts\Container\ContextualAttribute;
7+
use ReflectionAttribute;
68
use ReflectionNamedType;
79
/**
810
* @internal
@@ -62,4 +64,14 @@ public static function getParameterClassName($parameter)
6264
}
6365
return $name;
6466
}
67+
/**
68+
* Get a contextual attribute from a dependency.
69+
*
70+
* @param \ReflectionParameter $dependency
71+
* @return \ReflectionAttribute|null
72+
*/
73+
public static function getContextualAttributeFromDependency($dependency)
74+
{
75+
return (\method_exists($dependency, 'getAttributes') ? $dependency->getAttributes(ContextualAttribute::class, ReflectionAttribute::IS_INSTANCEOF) : [])[0] ?? null;
76+
}
6577
}

vendor/phpstan/phpdoc-parser/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ For the complete list of supported PHPDoc features check out PHPStan documentati
1313

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

1818
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.
1919

0 commit comments

Comments
 (0)