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

nepada / message-bus / 6499378211

12 Oct 2023 06:00PM UTC coverage: 96.474% (+0.3%) from 96.19%
6499378211

push

github

xificurk
Add missing transitive dependency symfony/deprecation-contracts

This should have been required by symfony/messenger, but it's missing.

301 of 312 relevant lines covered (96.47%)

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
     * @throws StaticAnalysisFailedException
17
     */
18
    public function extract(HandlerType $handlerType): MessageType
1✔
19
    {
20
        $handleMethod = ReflectionHelper::requireMethodReflection($handlerType->toString(), self::METHOD_NAME);
1✔
21

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

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

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

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