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

lmc-eu / matej-client-php / 7529439147

15 Jan 2024 01:18PM UTC coverage: 100.0%. Remained the same
7529439147

Pull #145

github

web-flow
Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #145: Bump actions/checkout from 3 to 4

712 of 712 relevant lines covered (100.0%)

35.03 hits per line

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

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

3
namespace Lmc\Matej\Exception;
4

5
use Psr\Http\Message\ResponseInterface;
6

7
/**
8
 * Exception thrown when Matej response cannot be decoded.
9
 */
10
final class ResponseDecodingException extends \RuntimeException implements MatejExceptionInterface
11
{
12
    public static function forJsonError(string $jsonErrorMsg, ResponseInterface $response): self
13
    {
14
        return new self(
7✔
15
            sprintf(
7✔
16
                "Error decoding Matej response: %s\n\nStatus code: %s %s\nBody:\n%s",
7✔
17
                $jsonErrorMsg,
7✔
18
                $response->getStatusCode(),
7✔
19
                $response->getReasonPhrase(),
7✔
20
                $response->getBody()
7✔
21
            )
7✔
22
        );
7✔
23
    }
24

25
    public static function forInvalidData(ResponseInterface $response): self
26
    {
27
        return new self(
7✔
28
            sprintf(
7✔
29
                "Error decoding Matej response: required data missing.\n\nBody:\n%s",
7✔
30
                $response->getBody()
7✔
31
            )
7✔
32
        );
7✔
33
    }
34

35
    public static function forInconsistentNumberOfCommands(int $numberOfCommands, int $commandResponsesCount): self
36
    {
37
        return new self(
14✔
38
            sprintf(
14✔
39
                'Provided numberOfCommands (%d) is inconsistent with actual count of command responses (%d)',
14✔
40
                $numberOfCommands,
14✔
41
                $commandResponsesCount
14✔
42
            )
14✔
43
        );
14✔
44
    }
45

46
    public static function forInconsistentNumbersOfCommandProperties(
47
        int $numberOfCommands,
48
        int $numberOfSuccessfulCommands,
49
        int $numberOfFailedCommands,
50
        int $numberOfSkippedCommands
51
    ): self {
52
        return new self(
7✔
53
            sprintf(
7✔
54
                'Provided numberOfCommands (%d) is inconsistent with provided sum of '
7✔
55
                . 'numberOfSuccessfulCommands (%d) + numberOfFailedCommands (%d)'
7✔
56
                . ' + numberOfSkippedCommands (%d)',
7✔
57
                $numberOfCommands,
7✔
58
                $numberOfSuccessfulCommands,
7✔
59
                $numberOfFailedCommands,
7✔
60
                $numberOfSkippedCommands
7✔
61
            )
7✔
62
        );
7✔
63
    }
64
}
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