Skip to content

Commit 701e7e4

Browse files
authored
PHPStan lvl 6 (#54)
1 parent 1bd716f commit 701e7e4

File tree

3 files changed

+15
-33
lines changed

3 files changed

+15
-33
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +0,0 @@
1-
parameters:
2-
ignoreErrors:
3-
-
4-
message: "#^Access to an undefined property Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:\\$customRepositoryClassName\\.$#"
5-
count: 1
6-
path: src/Codeception/Module/Doctrine2.php
7-
8-
-
9-
message: "#^Access to an undefined property Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\:\\:\\$name\\.$#"
10-
count: 1
11-
path: src/Codeception/Module/Doctrine2.php
12-
13-
-
14-
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectRepository\\:\\:createQueryBuilder\\(\\)\\.$#"
15-
count: 4
16-
path: src/Codeception/Module/Doctrine2.php
17-
18-
-
19-
message: "#^Dead catch \\- Doctrine\\\\Persistence\\\\Mapping\\\\MappingException is already caught by Doctrine\\\\Persistence\\\\Mapping\\\\MappingException above\\.$#"
20-
count: 1
21-
path: src/Codeception/Module/Doctrine2.php
22-
23-
-
24-
message: "#^Unable to resolve the template type T in call to method Codeception\\\\Module\\\\Doctrine2\\:\\:instantiateAndPopulateEntity\\(\\)$#"
25-
count: 2
26-
path: src/Codeception/Module/Doctrine2.php
27-

phpstan.neon

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ includes:
22
- phpstan-baseline.neon
33

44
parameters:
5-
level: 3
5+
level: 6
66
paths:
77
- src
88
- tests
@@ -15,8 +15,12 @@ parameters:
1515
reportUnmatchedIgnoredErrors: false
1616
ignoreErrors:
1717
- path: tests/
18-
message: '#no typehint specified#'
18+
message: '#Property \S+ is never read, only written#'
1919
- path: tests/
20-
message: '#no return typehint specified#'
20+
message: '#Property \S+ is unused#'
2121
- path: tests/
22-
message: '#does not specify its types#'
22+
message: '#Method \S+ has parameter \S+ with no type specified#'
23+
- path: tests/
24+
message: '#Method \S+ has no return type specified#'
25+
- path: tests/
26+
message: '#(?:Method|Property) .+ with generic (?:interface|class) \S+ does not specify its types#'

src/Codeception/Module/Doctrine2.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ public function _inject(DoctrineProvider $dependentModule = null): void
182182
$this->dependentModule = $dependentModule;
183183
}
184184

185+
/**
186+
* @param array<mixed> $settings
187+
*
188+
* @throws ModuleConfigException
189+
*/
185190
public function _beforeSuite($settings = []): void
186191
{
187192
$this->retrieveEntityManager();
@@ -704,8 +709,8 @@ public function loadFixtures($fixtures, bool $append = true): void
704709
}
705710

706711
try {
707-
$fixtureInstance = new $fixture;
708-
} catch (Exception $exception) {
712+
$fixtureInstance = new $fixture();
713+
} catch (Exception $exception) { // @phpstan-ignore-line https://github.com/phpstan/phpstan/issues/6574
709714
throw new ModuleException(
710715
__CLASS__,
711716
sprintf(

0 commit comments

Comments
 (0)