• 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/Model/CommandResponse.php
1
<?php declare(strict_types=1);
2

3
namespace Lmc\Matej\Model;
4

5
use Lmc\Matej\Exception\ResponseDecodingException;
6

7
/**
8
 * Response to one single command which was part of request batch.
9
 */
10
class CommandResponse
11
{
12
    public const STATUS_OK = 'OK';
13
    /** @deprecated */
14
    public const STATUS_ERROR = 'ERROR';
15
    public const STATUS_SKIPPED = 'SKIPPED';
16
    public const STATUS_INVALID = 'INVALID';
17

18
    /** @var string */
19
    private $status;
20
    /** @var string */
21
    private $message;
22
    /** @var array */
23
    protected $data = [];
24

25
    private function __construct()
26
    {
27
    }
105✔
28

29
    /** @return static */
30
    public static function createFromRawCommandResponseObject(\stdClass $rawCommandResponseObject): self
31
    {
32
        if (!isset($rawCommandResponseObject->status)) {
112✔
33
            throw new ResponseDecodingException('Status field is missing in command response object');
7✔
34
        }
35

36
        $commandResponse = new static();
105✔
37
        $commandResponse->status = $rawCommandResponseObject->status;
105✔
38
        $commandResponse->message = $rawCommandResponseObject->message ?? '';
105✔
39
        $commandResponse->data = $rawCommandResponseObject->data ?? [];
105✔
40

41
        return $commandResponse;
105✔
42
    }
43

44
    public function getStatus(): string
45
    {
46
        return $this->status;
91✔
47
    }
48

49
    public function getMessage(): string
50
    {
51
        return $this->message;
56✔
52
    }
53

54
    public function getData(): array
55
    {
56
        return $this->data;
56✔
57
    }
58

59
    /**
60
     * Use this method to check whether this command response did not fail. Note both OK and SKIPPED statuses
61
     * are in fact marked as successful to provide this "command did not fail" detection.
62
     * This also means `Response::getNumberOfSuccessfulCommands()` don't necessarily return the same number of
63
     * command responses that return true on `CommandResponse::isSuccessful()` (as skipped command responses are
64
     * reported separately in `Response::getNumberOfSkippedCommands()`).
65
     */
66
    public function isSuccessful(): bool
67
    {
68
        return $this->getStatus() === static::STATUS_OK || $this->getStatus() === static::STATUS_SKIPPED;
42✔
69
    }
70
}
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