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

3
namespace Lmc\Matej\Model\Command;
4

5
use Lmc\Matej\Model\Assertion;
6

7
/**
8
 * Deliver recommendations.
9
 */
10
abstract class AbstractRecommendation extends AbstractCommand
11
{
12
    /** @var int */
13
    private $count;
14
    /** @var string */
15
    private $scenario;
16
    /** @var string|null */
17
    private $modelName;
18

19
    protected function __construct(string $scenario)
20
    {
21
        $this->setScenario($scenario);
119✔
22
    }
23

24
    /**
25
     * Set A/B model name
26
     *
27
     * @return $this
28
     */
29
    public function setModelName(string $modelName): self
30
    {
31
        Assertion::typeIdentifier($modelName);
28✔
32

33
        $this->modelName = $modelName;
28✔
34

35
        return $this;
28✔
36
    }
37

38
    /**
39
     * Set number of requested recommendations. The real number of recommended items could be lower or even zero when
40
     * there are no items relevant for the user.
41
     *
42
     * @return $this
43
     */
44
    public function setCount(int $count): self
45
    {
46
        Assertion::greaterThan($count, 0);
28✔
47

48
        $this->count = $count;
28✔
49

50
        return $this;
28✔
51
    }
52

53
    protected function setScenario(string $scenario): void
54
    {
55
        Assertion::typeIdentifier($scenario);
119✔
56

57
        $this->scenario = $scenario;
119✔
58
    }
59

60
    protected function getCommandParameters(): array
61
    {
62
        $parameters = [
119✔
63
            'scenario' => $this->scenario,
119✔
64
        ];
119✔
65

66
        if ($this->count !== null) {
119✔
67
            $parameters['count'] = $this->count;
28✔
68
        }
69

70
        if ($this->modelName !== null) {
119✔
71
            $parameters['model_name'] = $this->modelName;
28✔
72
        }
73

74
        return $parameters;
119✔
75
    }
76
}
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