Skip to content

Commit e172840

Browse files
committed
Add reproducer
1 parent c1b7970 commit e172840

File tree

8 files changed

+243
-3
lines changed

8 files changed

+243
-3
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@
88
/var/
99
/vendor/
1010
###< symfony/framework-bundle ###
11+
12+
###> phpstan/phpstan ###
13+
phpstan.neon
14+
###< phpstan/phpstan ###

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@
99
"ext-iconv": "*",
1010
"symfony/console": "7.2.*",
1111
"symfony/dotenv": "7.2.*",
12-
"symfony/flex": "^2",
12+
"symfony/flex": "^2.5",
1313
"symfony/framework-bundle": "7.2.*",
1414
"symfony/runtime": "7.2.*",
1515
"symfony/yaml": "7.2.*"
1616
},
1717
"require-dev": {
18+
"phpstan/extension-installer": "^1.4.3",
19+
"phpstan/phpstan-symfony": "^2.0.4"
1820
},
1921
"config": {
2022
"allow-plugins": {
2123
"php-http/discovery": true,
24+
"phpstan/extension-installer": true,
2225
"symfony/flex": true,
2326
"symfony/runtime": true
2427
},

composer.lock

Lines changed: 180 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.dist.neon

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
parameters:
2+
level: 6
3+
paths:
4+
- bin/
5+
- config/
6+
- public/
7+
- src/
8+
# - tests/
9+
10+
symfony:
11+
containerXmlPath: var/cache/dev/App_KernelDevDebugContainer.xml

src/Reproducer/Consumer.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace App\Reproducer;
4+
5+
use Psr\Container\ContainerInterface;
6+
use Symfony\Component\DependencyInjection\Attribute\AutowireLocator;
7+
8+
class Foo
9+
{
10+
public function __construct(
11+
#[AutowireLocator(MyInterface::class)]
12+
private ContainerInterface $container,
13+
) {}
14+
15+
public function consume(): void
16+
{
17+
$this->container->get(Foo::class);
18+
}
19+
}

src/Reproducer/Foo.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
namespace App\Reproducer;
4+
5+
class Foo implements MyInterface {}

src/Reproducer/MyInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace App\Reproducer;
4+
5+
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
6+
7+
#[AutoconfigureTag()]
8+
interface MyInterface {}

symfony.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
{
2+
"phpstan/phpstan": {
3+
"version": "2.1",
4+
"recipe": {
5+
"repo": "github.com/symfony/recipes-contrib",
6+
"branch": "main",
7+
"version": "1.0",
8+
"ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767"
9+
},
10+
"files": [
11+
"phpstan.dist.neon"
12+
]
13+
},
214
"symfony/console": {
315
"version": "7.2",
416
"recipe": {

0 commit comments

Comments
 (0)