• 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

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

4
namespace Nepada\MessageBus\StaticAnalysis;
5

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

8
/**
9
 * @template T of MessageHandlerInterface
10
 */
11
final class HandlerType
12
{
13

14
    /**
15
     * @var class-string<T>
16
     */
17
    private string $type;
18

19
    /**
20
     * @param class-string<T> $type
21
     */
22
    private function __construct(string $type)
1✔
23
    {
24
        $this->type = $type;
1✔
25
    }
1✔
26

27
    /**
28
     * @param T $handler
29
     * @return HandlerType<T>
30
     */
31
    public static function fromHandler(MessageHandlerInterface $handler): self
32
    {
33
        return new self(get_class($handler));
×
34
    }
35

36
    /**
37
     * @param class-string<T> $type
38
     * @return HandlerType<T>
39
     */
40
    public static function fromString(string $type): self
1✔
41
    {
42
        return new self($type);
1✔
43
    }
44

45
    /**
46
     * @return class-string<T>
47
     */
48
    public function toString(): string
49
    {
50
        return $this->type;
1✔
51
    }
52

53
    /**
54
     * @template TOther of MessageHandlerInterface
55
     * @param HandlerType<TOther> $handlerType
56
     * @return bool
57
     */
58
    public function isSubtypeOf(HandlerType $handlerType): bool
59
    {
60
        return is_subclass_of($this->type, $handlerType->toString());
×
61
    }
62

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

© 2026 Coveralls, Inc