8000 [Symfony] Add patch removing final on set() in ServicesConfigurator · rectorphp/rector-src@0853c28 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0853c28

Browse files
committed
[Symfony] Add patch removing final on set() in ServicesConfigurator
1 parent 511d649 commit 0853c28

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"symplify/phpstan-extensions": "^10.0",
7171
"symplify/phpstan-rules": "^10.0",
7272
"symplify/rule-doc-generator": "^10.0",
73+
"symplify/vendor-patches": "^10.0",
7374
"timeweb/phpstan-enum": "dev-22-upgrade-phpstan-to-1.0"
7475
},
7576
"replace": {
@@ -142,6 +143,11 @@
142143
"release": "vendor/bin/monorepo-builder release patch --ansi"
143144
},
144145
"extra": {
146+
"patches": {
147+
"symfony/dependency-injection": [
148+
"patches/symfony-dependency-injection-loader-configurator-servicesconfigurator-php.patch"
149+
]
150+
},
145151
"branch-alias": {
146152
"dev-main": "0.12-dev"
147153
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- /dev/null
2+
+++ ../Loader/Configurator/ServicesConfigurator.php
3+
@@ -70,7 +70,7 @@
4+
* @param string|null $id The service id, or null to create an anonymous service
5+
* @param string|null $class The class of the service, or null when $id is also the class name
6+
*/
7+
- final public function set(?string $id, string $class = null): ServiceConfigurator
8+
+ final public function set(?string $id, string $class = null): \Rector\Core\DependencyInjection\Loader\Configurator\RectorServiceConfigurator
9+
{
10+
$defaults = $this->defaults;
11+
$definition = new Definition();
12+
@@ -91,7 +91,7 @@
13+
$definition->setBindings(unserialize(serialize($defaults->getBindings())));
14+
$definition->setChanges([]);
15+
16+
- $configurator = new ServiceConfigurator($this->container, $this->instanceof, true, $this, $definition, $id, $defaults->getTags(), $this->path);
17+
+ $configurator = new \Rector\Core\DependencyInjection\Loader\Configurator\RectorServiceConfigurator($this->container, $this->instanceof, true, $this, $definition, $id, $defaults->getTags(), $this->path);
18+
19+
return null !== $class ? $configurator->class($class) : $configurator;
20+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Core\DependencyInjection\Loader\Configurator;
6+
7+
use Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator;
8+
9+
/**
10+
* Same as Symfony service configurator, with extra "configure()" method for easier DX
11+
*/
12+
final class RectorServiceConfigurator extends ServiceConfigurator
13+
{
14+
15+
}

0 commit comments

Comments
 (0)
0