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

IlyasDeckers / ody-core / 13589380408

28 Feb 2025 01:41PM UTC coverage: 13.422% (-19.7%) from 33.151%
13589380408

push

github

IlyasDeckers
add support classes/methods (wip)

0 of 2412 new or added lines in 16 files covered. (0.0%)

544 of 4053 relevant lines covered (13.42%)

4.04 hits per line

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

0.0
/src/Support/Collection/HigherOrderCollectionProxy.php
1
<?php
2

3
declare(strict_types=1);
4

5

6
namespace Ody\Core\Support\Collection;
7

8
/**
9
 * @template TKey of array-key
10
 * @template TValue
11
 *
12
 * @mixin Enumerable
13
 * @mixin TValue
14
 */
15
class HigherOrderCollectionProxy
16
{
17
    /**
18
     * Create a new proxy instance.
19
     * @param Enumerable<TKey, TValue> $collection the collection being operated on
20
     * @param string $method the method being proxied
21
     */
NEW
22
    public function __construct(protected Enumerable $collection, protected string $method)
×
23
    {
NEW
24
    }
×
25

26
    /**
27
     * Proxy accessing an attribute onto the collection items.
28
     */
NEW
29
    public function __get(string $key)
×
30
    {
NEW
31
        return $this->collection->{$this->method}(function ($value) use ($key) {
×
NEW
32
            return is_array($value) ? $value[$key] : $value->{$key};
×
NEW
33
        });
×
34
    }
35

36
    /**
37
     * Proxy a method call onto the collection items.
38
     */
NEW
39
    public function __call(string $method, array $parameters)
×
40
    {
NEW
41
        return $this->collection->{$this->method}(function ($value) use ($method, $parameters) {
×
NEW
42
            return $value->{$method}(...$parameters);
×
NEW
43
        });
×
44
    }
45
}
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