• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nepada / phpstan-message-bus / 4585627559

pending completion
4585627559

Pull #53

github

GitHub
Merge a101dc8e9 into 774cdb7c9
Pull Request #53: Update phpstan/phpstan-phpunit requirement from 1.3.9 to 1.3.11

57 of 67 relevant lines covered (85.07%)

1.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/MessageBus/CommandTypeExtractor.php
1
<?php
2
declare(strict_types = 1);
3

4
namespace Nepada\PHPStan\MessageBus;
5

6
use PhpParser\Node\Expr\MethodCall;
7
use PhpParser\Node\VariadicPlaceholder;
8
use PHPStan\Analyser\Scope;
9
use PHPStan\Type\TypeWithClassName;
10

11
class CommandTypeExtractor
12
{
13

14
    public function extractCommandType(MethodCall $methodCall, Scope $scope): ?string
15
    {
16
        if (count($methodCall->args) === 0) {
2✔
17
            return null;
×
18
        }
19

20
        $commandArgument = $methodCall->args[0];
2✔
21
        if ($commandArgument instanceof VariadicPlaceholder) {
2✔
22
            return null;
×
23
        }
24

25
        $commandType = $scope->getType($commandArgument->value);
2✔
26
        if (! $commandType instanceof TypeWithClassName) {
2✔
27
            return null;
×
28
        }
29

30
        return $commandType->getClassName();
2✔
31
    }
32

33
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc