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

lmc-eu / matej-client-php / 7536558481

15 Jan 2024 01:31PM UTC coverage: 100.0%. Remained the same
7536558481

push

github

OndraM
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>

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

3
namespace Lmc\Matej\RequestBuilder;
4

5
use Fig\Http\Message\RequestMethodInterface;
6
use Lmc\Matej\Exception\LogicException;
7
use Lmc\Matej\Model\Assertion;
8
use Lmc\Matej\Model\Command\ItemPropertySetup;
9
use Lmc\Matej\Model\Request;
10

11
class ItemPropertiesSetupRequestBuilder extends AbstractRequestBuilder
12
{
13
    protected const ENDPOINT_PATH = '/item-properties';
14

15
    /** @var ItemPropertySetup[] */
16
    protected $commands = [];
17
    /** @var bool */
18
    protected $shouldDelete = false;
19

20
    /**
21
     * @param bool $shouldDelete Should the request delete item properties instead of creating new?
22
     */
23
    public function __construct(bool $shouldDelete = false)
24
    {
25
        $this->shouldDelete = $shouldDelete;
42✔
26
    }
27

28
    /** @return $this */
29
    public function addProperty(ItemPropertySetup $itemPropertySetup): self
30
    {
31
        $this->commands[] = $itemPropertySetup;
35✔
32

33
        return $this;
35✔
34
    }
35

36
    /**
37
     * @param ItemPropertySetup[] $itemPropertiesSetup
38
     * @return $this
39
     */
40
    public function addProperties(array $itemPropertiesSetup): self
41
    {
42
        foreach ($itemPropertiesSetup as $itemPropertySetup) {
14✔
43
            $this->addProperty($itemPropertySetup);
14✔
44
        }
45

46
        return $this;
14✔
47
    }
48

49
    public function build(): Request
50
    {
51
        if (empty($this->commands)) {
35✔
52
            throw new LogicException(
7✔
53
                'At least one ItemPropertySetup command must be added to the builder before sending the request'
7✔
54
            );
7✔
55
        }
56
        Assertion::batchSize($this->commands);
28✔
57

58
        $method = $this->shouldDelete ? RequestMethodInterface::METHOD_DELETE : RequestMethodInterface::METHOD_PUT;
21✔
59

60
        return new Request(static::ENDPOINT_PATH, $method, $this->commands, $this->requestId);
21✔
61
    }
62
}
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