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

PHP-Alchemist / coreFiles / 15423302022

03 Jun 2025 04:58PM UTC coverage: 92.411%. First build
15423302022

Pull #9

github

druid628
CS Fixes
Pull Request #9: [Release] v3.0.0

144 of 175 new or added lines in 16 files covered. (82.29%)

548 of 593 relevant lines covered (92.41%)

4.95 hits per line

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

80.0
/src/Abstract/AbstractList.php
1
<?php
2

3
namespace PHPAlchemist\Abstract;
4

5
/**
6
 * Abstract class for List (Roll) Objectified array class.
7
 */
8
abstract class AbstractList extends AbstractIndexedArray
9
{
10
    /**
11
     * @inheritDoc
12
     */
13
    public function offsetUnset(mixed $offset) : void
1✔
14
    {
15
        parent::offsetUnset($offset);
1✔
16
        if (!$this->isList()) {
1✔
17
            $this->rebalanceData();
1✔
18
        }
19
    }
20

21
    /**
22
     * @inheritDoc
23
     */
24
    public function offsetSet(mixed $offset, mixed $value) : void
1✔
25
    {
26
        parent::offsetSet($offset, $value);
1✔
27
        if (!$this->isList()) {
1✔
28
            $this->rebalanceData();
1✔
29
        }
30
    }
31

32
    /**
33
     * Reset the keys to 0,1,2,3,...
34
     *
35
     * @return void
36
     */
37
    protected function rebalanceData() : void
1✔
38
    {
39
        $this->data = array_values($this->data);
1✔
40
    }
41

42
    /**
43
     * Determine if array is a List.
44
     *
45
     * @return bool
46
     */
47
    protected function isList() : bool
1✔
48
    {
49
        return array_is_list($this->data) && ($this instanceof AbstractList);
1✔
50
    }
51

52
    /**
53
     * Uses generator to step through List data.
54
     *
55
     * @return mixed
56
     */
57
    public function parseData() : mixed
×
58
    {
59
        foreach ($this->data as $data) {
×
60
            yield $data;
×
61
        }
62
    }
63
}
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