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

Cecilapp / Cecil / 7126338718

07 Dec 2023 09:37AM UTC coverage: 80.668% (-1.9%) from 82.534%
7126338718

Pull #1676

github

web-flow
Merge db214c75c into 814daa587
Pull Request #1676: 8.x dev

174 of 212 new or added lines in 28 files covered. (82.08%)

102 existing lines in 10 files now uncovered.

2779 of 3445 relevant lines covered (80.67%)

0.81 hits per line

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

88.89
/src/Collection/Item.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of Cecil.
7
 *
8
 * Copyright (c) Arnaud Ligny <arnaud@ligny.fr>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13

14
namespace Cecil\Collection;
15

16
/**
17
 * Class Item.
18
 */
19
class Item implements ItemInterface
20
{
21
    /** @var string Item's identifier. */
22
    protected $id;
23

24
    /** @var array Item's properties. */
25
    protected $properties = [];
26

27
    public function __construct(string $id)
28
    {
29
        $this->setId($id);
1✔
30
    }
31

32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function setId(string $id): BaseInterface
36
    {
37
        $this->id = $id;
1✔
38

39
        return $this;
1✔
40
    }
41

42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getId(): string
46
    {
47
        return $this->id;
1✔
48
    }
49

50
    /**
51
     * Implements \ArrayAccess.
52
     *
53
     * @param mixed $offset
54
     *
55
     * @return bool
56
     */
57
    #[\ReturnTypeWillChange]
58
    public function offsetExists($offset): bool
59
    {
60
        return \array_key_exists($offset, $this->properties);
1✔
61
    }
62

63
    /**
64
     * Implements \ArrayAccess.
65
     *
66
     * @param mixed $offset
67
     *
68
     * @return mixed|null
69
     */
70
    #[\ReturnTypeWillChange]
71
    public function offsetGet($offset)
72
    {
73
        return $this->properties[$offset];
1✔
74
    }
75

76
    /**
77
     * Implements \ArrayAccess.
78
     *
79
     * @param mixed $offset
80
     * @param mixed $value
81
     */
82
    #[\ReturnTypeWillChange]
83
    public function offsetSet($offset, $value): void
84
    {
85
        $this->properties[$offset] = $value;
1✔
86
    }
87

88
    /**
89
     * Implements \ArrayAccess.
90
     *
91
     * @param mixed $offset
92
     */
93
    #[\ReturnTypeWillChange]
94
    public function offsetUnset($offset): void
95
    {
UNCOV
96
        unset($this->properties[$offset]);
×
97
    }
98

99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function toArray(): array
103
    {
104
        return $this->properties;
1✔
105
    }
106
}
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