Skip to content

Commit 22ec04d

Browse files
committed
Raise psalm level to the max
1 parent ee6e0d3 commit 22ec04d

File tree

4 files changed

+5
-46
lines changed

4 files changed

+5
-46
lines changed

phpstan.neon

Lines changed: 0 additions & 4 deletions
This file was deleted.

psalm.xml

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<psalm
3-
totallyTyped="false"
3+
errorLevel="1"
44
resolveFromConfigFile="true"
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66
xmlns="https://getpsalm.org/schema/config"
@@ -12,44 +12,4 @@
1212
<directory name="vendor" />
1313
</ignoreFiles>
1414
</projectFiles>
15-
16-
<issueHandlers>
17-
<LessSpecificReturnType errorLevel="info" />
18-
19-
<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->
20-
21-
<DeprecatedMethod errorLevel="info" />
22-
<DeprecatedProperty errorLevel="info" />
23-
<DeprecatedClass errorLevel="info" />
24-
<DeprecatedConstant errorLevel="info" />
25-
<DeprecatedFunction errorLevel="info" />
26-
<DeprecatedInterface errorLevel="info" />
27-
<DeprecatedTrait errorLevel="info" />
28-
29-
<InternalMethod errorLevel="info" />
30-
<InternalProperty errorLevel="info" />
31-
<InternalClass errorLevel="info" />
32-
33-
<MissingClosureReturnType errorLevel="info" />
34-
<MissingReturnType errorLevel="info" />
35-
<MissingPropertyType errorLevel="info" />
36-
<InvalidDocblock errorLevel="info" />
37-
<MisplacedRequiredParam errorLevel="info" />
38-
39-
<PropertyNotSetInConstructor errorLevel="info" />
40-
<MissingConstructor errorLevel="info" />
41-
<MissingClosureParamType errorLevel="info" />
42-
<MissingParamType errorLevel="info" />
43-
44-
<RedundantCondition errorLevel="info" />
45-
46-
<DocblockTypeContradiction errorLevel="info" />
47-
<RedundantConditionGivenDocblockType errorLevel="info" />
48-
49-
<UnresolvableInclude errorLevel="info" />
50-
51-
<RawObjectIteration errorLevel="info" />
52-
53-
<InvalidStringClass errorLevel="info" />
54-
</issueHandlers>
5515
</psalm>

src/CommandResponse/CommandResponseEventsTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/**
1313
* Trait CommandResponseEventsTrait
1414
* @package JeckelLab\CommandDispatcher\CommandResponse
15+
* @psalm-immutable
1516
*/
1617
trait CommandResponseEventsTrait
1718
{

src/Resolver/CommandHandlerResolver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ public function resolve(Command $command): CommandHandler
5050
}
5151

5252
if ($this->container !== null && $this->container->has($handler)) {
53-
return $this->container->get($handler);
53+
$instance = $this->container->get($handler);
54+
assert($instance instanceof CommandHandler, 'Handler should be an instance of CommandHandler');
55+
return $instance;
5456
}
5557

5658
throw new HandlerNotFoundException(sprintf(

0 commit comments

Comments
 (0)