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

nepada / message-bus / 4581487412

pending completion
4581487412

push

github

GitHub
Update spaze/phpstan-disallowed-calls requirement from 2.11.6 to 2.12.1 (#75)

303 of 315 relevant lines covered (96.19%)

0.96 hits per line

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

77.78
/src/MessageBus/StaticAnalysis/MessageTypeExtractor.php
1
<?php
2
declare(strict_types = 1);
3

4
namespace Nepada\MessageBus\StaticAnalysis;
5

6
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
7

8
final class MessageTypeExtractor
9
{
10

11
    public const METHOD_NAME = '__invoke';
12

13
    /**
14
     * @template T of MessageHandlerInterface
15
     * @param HandlerType<T> $handlerType
16
     * @return MessageType
17
     * @throws StaticAnalysisFailedException
18
     */
19
    public function extract(HandlerType $handlerType): MessageType
1✔
20
    {
21
        $handleMethod = ReflectionHelper::requireMethodReflection($handlerType->toString(), self::METHOD_NAME);
1✔
22

23
        $handleMethodParameters = $handleMethod->getParameters();
1✔
24
        $handleMethodParameter = $handleMethodParameters[0];
1✔
25

26
        $parameterType = $handleMethodParameter->getType();
1✔
27
        if ($parameterType === null) {
1✔
28
            throw new \LogicException(
×
29
                sprintf('Handle method parameter type of class "%s" must be defined in this context.', $handlerType->toString()),
×
30
            );
31
        }
32

33
        return MessageType::fromString($parameterType->getName());
1✔
34
    }
35

36
}
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