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

webeweb / xmltv-library / 3738377406

pending completion
3738377406

push

github

webeweb
Update CHANGELOG

1302 of 1306 relevant lines covered (99.69%)

294.88 hits per line

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

100.0
/src/Model/Attribute/ArrayCommentatorsTrait.php
1
<?php
2

3
/*
4
 * This file is part of the xmltv-library package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
namespace WBW\Library\XmlTv\Model\Attribute;
13

14
use WBW\Library\XmlTv\Model\Commentator;
15

16
/**
17
 * Array commentators trait.
18
 *
19
 * @author webeweb <https://github.com/webeweb>
20
 * @package WBW\Library\XmlTv\Model\Attribute
21
 */
22
trait ArrayCommentatorsTrait {
23

24
    /**
25
     * Commentators.
26
     *
27
     * @var Commentator[]
28
     */
29
    protected $commentators;
30

31
    /**
32
     * Add a commentator.
33
     *
34
     * @param Commentator $commentator The commentator.
35
     * @return self Returns this instance.
36
     */
37
    public function addCommentator(Commentator $commentator): self {
38
        $this->commentators[] = $commentator;
364✔
39
        return $this;
364✔
40
    }
41

42
    /**
43
     * Get the commentators.
44
     *
45
     * @return Commentator[] Returns the commentators.
46
     */
47
    public function getCommentators(): array {
48
        return $this->commentators;
91✔
49
    }
50

51
    /**
52
     * Get the number of commentators.
53
     *
54
     * @return int Returns the number of commentators.
55
     */
56
    public function getNumberCommentators(): int {
57
        return count($this->getCommentators());
14✔
58
    }
59

60
    /**
61
     * Determines if this instance has commentators.
62
     *
63
     * @return bool Returns true in case of success, false otherwise.
64
     */
65
    public function hasCommentators(): bool {
66
        return 1 <= $this->getNumberCommentators();
14✔
67
    }
68

69
    /**
70
     * Set the commentators.
71
     *
72
     * @param Commentator[] $commentators The commentators.
73
     * @return self Returns this instance.
74
     */
75
    protected function setCommentators(array $commentators): self {
76
        $this->commentators = $commentators;
2,345✔
77
        return $this;
2,345✔
78
    }
79
}
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