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

lmc-eu / matej-client-php / 7527331519

15 Jan 2024 10:11AM UTC coverage: 100.0%. Remained the same
7527331519

Pull #135

github

web-flow
Merge 117257645 into 9666a6254
Pull Request #135: Update to new coding standard

20 of 21 new or added lines in 5 files covered. (95.24%)

400 existing lines in 23 files now uncovered.

758 of 758 relevant lines covered (100.0%)

18.54 hits per line

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

100.0
/src/Exception/LogicException.php
1
<?php declare(strict_types=1);
2

3
namespace Lmc\Matej\Exception;
4

5
use Lmc\Matej\Model\Command\UserAwareInterface;
6

7
/**
8
 * Exception represents error in the program logic.
9
 */
10
class LogicException extends \LogicException implements MatejExceptionInterface
11
{
12
    public static function forInconsistentUserId(
13
        UserAwareInterface $mainCommand,
14
        UserAwareInterface $additionalCommand
15
    ): self {
UNCOV
16
        $message = sprintf(
8✔
UNCOV
17
            'User in %s command ("%s") must be the same as user in %s command ("%s")',
8✔
UNCOV
18
            (new \ReflectionClass($additionalCommand))->getShortName(),
8✔
UNCOV
19
            $additionalCommand->getUserId(),
8✔
UNCOV
20
            (new \ReflectionClass($mainCommand))->getShortName(),
8✔
UNCOV
21
            $mainCommand->getUserId()
8✔
UNCOV
22
        );
6✔
23

UNCOV
24
        return new self($message);
8✔
25
    }
26

27
    public static function forInconsistentUserMergeAndInteractionCommand(
28
        string $userMergeId,
29
        string $interactionUserId
30
    ): self {
UNCOV
31
        $message = sprintf(
4✔
UNCOV
32
            'Source user in UserMerge command ("%s") must be the same as user in Interaction command ("%s")',
4✔
UNCOV
33
            $userMergeId,
3✔
UNCOV
34
            $interactionUserId
3✔
UNCOV
35
        );
3✔
36

UNCOV
37
        return new self($message);
4✔
38
    }
39

40
    public static function forClassNotExtendingOtherClass(string $class, string $wantedClass): self
41
    {
UNCOV
42
        return new self(sprintf('Class %s has to be instance or subclass of %s.', $class, $wantedClass));
4✔
43
    }
44
}
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