Skip to content

Commit 6baa42f

Browse files
rattusczondrejmirtes
authored andcommitted
Test for @Inject doc
1 parent 348cb61 commit 6baa42f

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace PHPStan\Rule\Nette;
4+
5+
class PresenterInjectedPropertiesExtensionTest extends \PHPStan\Testing\LevelsTestCase
6+
{
7+
8+
public function dataTopics(): array
9+
{
10+
return [
11+
['presenterInject'],
12+
];
13+
}
14+
15+
public function getDataPath(): string
16+
{
17+
return __DIR__ . '/data';
18+
}
19+
20+
public function getPhpStanExecutablePath(): string
21+
{
22+
return __DIR__ . '/../../../vendor/bin/phpstan';
23+
}
24+
25+
public function getPhpStanConfigPath(): ?string
26+
{
27+
return __DIR__ . '/phpstan.neon';
28+
}
29+
30+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
class Service
4+
{
5+
6+
}
7+
8+
class InjectPresenter
9+
{
10+
/** @var Service @inject */
11+
public Service $service;
12+
}

tests/Rule/Nette/phpstan.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
checkUninitializedProperties: true
3+
4+
includes:
5+
- ../../../extension.neon
6+
- ../../../rules.neon
7+
- phar://phpstan.phar/conf/bleedingEdge.neon

0 commit comments

Comments
 (0)