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

fractalzombie / frzb-transactional-messenger / 8471652867

28 Mar 2024 06:00PM UTC coverage: 94.915%. Remained the same
8471652867

push

github

fractalzombie
[TransactionalMessenger] Fix for DispatchException when terminate command

0 of 1 new or added line in 1 file covered. (0.0%)

112 of 118 relevant lines covered (94.92%)

25.31 hits per line

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

33.33
/Exception/DispatchException.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
7
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9
 *
10
 * Copyright (c) 2024 Mykhailo Shtanko fractalzombie@gmail.com
11
 *
12
 * For the full copyright and license information, please view the LICENSE.MD
13
 * file that was distributed with this source code.
14
 */
15

16
namespace FRZB\Component\TransactionalMessenger\Exception;
17

18
use JetBrains\PhpStorm\Immutable;
19
use Symfony\Component\Console\Event\ConsoleSignalEvent;
20

21
#[Immutable]
22
final class DispatchException extends \LogicException
23
{
24
    private const MESSAGE_SIGNAL_CONSOLE_EVENT = 'Rollback transaction: Message was interrupted in "%s" command on signal';
25

26
    public static function fromSignal(ConsoleSignalEvent $event): self
27
    {
NEW
28
        $message = sprintf(self::MESSAGE_SIGNAL_CONSOLE_EVENT, $event->getCommand()->getName());
×
29

30
        return new self($message, $event->getHandlingSignal());
×
31
    }
32

33
    public static function fromThrowable(\Throwable $previous): self
34
    {
35
        return new self($previous->getMessage(), (int) $previous->getCode(), $previous);
18✔
36
    }
37
}
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