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

webeweb / xmltv-library / 3821848929

pending completion
3821848929

push

github

webeweb
Remove unused configuration files

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/ArrayAdaptersTrait.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\Adapter;
15

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

24
    /**
25
     * Adapters.
26
     *
27
     * @var Adapter[]
28
     */
29
    protected $adapters;
30

31
    /**
32
     * Add an adapter.
33
     *
34
     * @param Adapter $adapter The adapter.
35
     * @return self Returns this instance.
36
     */
37
    public function addAdapter(Adapter $adapter): self {
38
        $this->adapters[] = $adapter;
364✔
39
        return $this;
364✔
40
    }
41

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

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

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

69
    /**
70
     * Set the adapters.
71
     *
72
     * @param Adapter[] $adapters The adapters.
73
     * @return self Returns this instance.
74
     */
75
    protected function setAdapters(array $adapters): self {
76
        $this->adapters = $adapters;
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

© 2026 Coveralls, Inc