Skip to content

Commit 920c5d7

Browse files
authored
Merge pull request #26 from Jeckel-Lab/dependabot/composer/vimeo/psalm-tw-3.8or-tw-4.0
Update vimeo/psalm requirement from ^3.8 to ^3.8 || ^4.0
2 parents 32a29ca + 22ec04d commit 920c5d7

File tree

5 files changed

+6
-47
lines changed

5 files changed

+6
-47
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"phpunit/phpunit": "^8.4",
3030
"phpmd/phpmd": "^2.7",
3131
"squizlabs/php_codesniffer": "^3.5",
32-
"vimeo/psalm": "^3.8",
32+
"vimeo/psalm": "^3.8 || ^4.0",
3333
"phpro/grumphp": "^0.19.0"
3434
}
3535
}

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)