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

tempestphp / tempest-framework / 14049246919

24 Mar 2025 09:42PM UTC coverage: 79.353% (-0.04%) from 79.391%
14049246919

push

github

web-flow
feat(support): support array parameters in string manipulations (#1073)

48 of 48 new or added lines in 2 files covered. (100.0%)

735 existing lines in 126 files now uncovered.

10492 of 13222 relevant lines covered (79.35%)

90.78 hits per line

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

85.0
/src/Tempest/EventBus/src/EventBusConfig.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\EventBus;
6

7
use Closure;
8
use Tempest\Reflection\MethodReflector;
9

10
final class EventBusConfig
11
{
12
    public function __construct(
666✔
13
        /** @var array<string,array<\Tempest\EventBus\CallableEventHandler>> */
14
        public array $handlers = [],
15

16
        /** @var array<array-key, class-string<\Tempest\EventBus\EventBusMiddleware>> */
17
        public array $middleware = [],
18
    ) {}
666✔
19

20
    public function addClosureHandler(string $event, Closure $handler): self
12✔
21
    {
22
        $handlerKey = spl_object_hash($handler);
12✔
23

24
        $this->handlers[$event][$handlerKey] = new CallableEventHandler(
12✔
25
            event: $event,
12✔
26
            handler: $handler,
12✔
27
        );
12✔
28

29
        return $this;
12✔
30
    }
31

32
    public function addClassMethodHandler(string $event, EventHandler $handler, MethodReflector $reflectionMethod): self
660✔
33
    {
34
        $handlerKey = $reflectionMethod->getDeclaringClass()->getName() . '::' . $reflectionMethod->getName();
660✔
35
        $handler->setEventName($event)->setHandler($reflectionMethod);
660✔
36

37
        $this->handlers[$event][$handlerKey] = new CallableEventHandler(
660✔
38
            event: $event,
660✔
39
            handler: $handler,
660✔
40
        );
660✔
41

42
        return $this;
660✔
43
    }
44

45
    /** @param class-string<\Tempest\EventBus\EventBusMiddleware> $middlewareClass */
UNCOV
46
    public function addMiddleware(string $middlewareClass): self
×
47
    {
UNCOV
48
        $this->middleware[] = $middlewareClass;
×
49

UNCOV
50
        return $this;
×
51
    }
52
}
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