• 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

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($handler::class);
×
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
     */
57
    public function isSubtypeOf(self $handlerType): bool
58
    {
59
        return is_subclass_of($this->type, $handlerType->toString());
×
60
    }
61

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