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

3
namespace Lmc\Matej\Model\Command;
4

5
use Lmc\Matej\Model\Assertion;
6
use Lmc\Matej\Model\Command\Constants\PropertyType;
7

8
/**
9
 * Command to add or delete item property in the database.
10
 */
11
class ItemPropertySetup extends AbstractCommand
12
{
13
    /** @var string */
14
    private $propertyName;
15
    /** @var PropertyType */
16
    private $propertyType;
17

18
    private function __construct(string $propertyName, PropertyType $propertyType)
19
    {
20
        $this->setPropertyName($propertyName);
98✔
21
        $this->propertyType = $propertyType;
49✔
22
    }
23

24
    /** @return static */
25
    public static function int(string $propertyName): self
26
    {
27
        return new static($propertyName, PropertyType::INT());
14✔
28
    }
29

30
    /** @return static */
31
    public static function double(string $propertyName): self
32
    {
33
        return new static($propertyName, PropertyType::DOUBLE());
14✔
34
    }
35

36
    /** @return static */
37
    public static function string(string $propertyName): self
38
    {
39
        return new static($propertyName, PropertyType::STRING());
14✔
40
    }
41

42
    /** @return static */
43
    public static function boolean(string $propertyName): self
44
    {
45
        return new static($propertyName, PropertyType::BOOLEAN());
14✔
46
    }
47

48
    /** @return static */
49
    public static function timestamp(string $propertyName): self
50
    {
51
        return new static($propertyName, PropertyType::TIMESTAMP());
14✔
52
    }
53

54
    /** @return static */
55
    public static function set(string $propertyName): self
56
    {
57
        return new static($propertyName, PropertyType::SET());
14✔
58
    }
59

60
    /** @return static */
61
    public static function geolocation(string $propertyName): self
62
    {
63
        return new static($propertyName, PropertyType::GEOLOCATION());
14✔
64
    }
65

66
    protected function setPropertyName(string $propertyName): void
67
    {
68
        Assertion::typeIdentifier($propertyName);
98✔
69
        Assertion::notEq(
98✔
70
            $propertyName,
98✔
71
            'item_id',
98✔
72
            'Cannot manipulate with property "item_id" - it is used by Matej to identify items.'
98✔
73
        );
98✔
74

75
        $this->propertyName = $propertyName;
49✔
76
    }
77

78
    protected function getCommandType(): string
79
    {
80
        return 'item-properties-setup';
49✔
81
    }
82

83
    protected function getCommandParameters(): array
84
    {
85
        return [
49✔
86
            'property_name' => $this->propertyName,
49✔
87
            'property_type' => $this->propertyType->jsonSerialize(),
49✔
88
        ];
49✔
89
    }
90
}
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