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

tempestphp / tempest-framework / 14424384667

12 Apr 2025 11:48PM UTC coverage: 79.996% (-1.2%) from 81.217%
14424384667

Pull #1149

github

web-flow
Merge a05336432 into 0c553d46c
Pull Request #1149: feat(storage): add storage component

149 of 403 new or added lines in 22 files covered. (36.97%)

11697 of 14622 relevant lines covered (80.0%)

104.56 hits per line

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

37.5
/src/Tempest/Storage/src/DirectoryListing.php
1
<?php
2

3
namespace Tempest\Storage;
4

5
use League\Flysystem\DirectoryListing as FlysystemDirectoryListing;
6
use Tempest\Support\Arr\ImmutableArray;
7
use Tempest\Support\Arr\MutableArray;
8
use Traversable;
9

10
/**
11
 * @template T
12
 */
13
final class DirectoryListing extends FlysystemDirectoryListing
14
{
15
    /**
16
     * @param iterable<T> $listing
17
     */
18
    public function __construct(
3✔
19
        private iterable $listing,
20
    ) {}
3✔
21

22
    /**
23
     * @param callable(T): bool $filter
24
     *
25
     * @return static<T>
26
     */
NEW
27
    public function filter(callable $filter): static
×
28
    {
NEW
29
        return new static(parent::filter($filter));
×
30
    }
31

32
    /**
33
     * @template R
34
     *
35
     * @param callable(T): R $mapper
36
     *
37
     * @return static<R>
38
     */
NEW
39
    public function map(callable $mapper): static
×
40
    {
NEW
41
        return new static(parent::map($mapper));
×
42
    }
43

44
    /**
45
     * @return static<T>
46
     */
NEW
47
    public function sortByPath(): static
×
48
    {
NEW
49
        return new static(parent::sortByPath());
×
50
    }
51

52
    /**
53
     * @return MutableArray<T>
54
     */
NEW
55
    public function toMutableArray(): MutableArray
×
56
    {
NEW
57
        return new MutableArray($this->toArray());
×
58
    }
59

60
    /**
61
     * @return ImmutableArray<T>
62
     */
NEW
63
    public function toImmutableArray(): ImmutableArray
×
64
    {
NEW
65
        return new ImmutableArray($this->toArray());
×
66
    }
67

68
    /**
69
     * @return T[]
70
     */
71
    public function toArray(): array
3✔
72
    {
73
        return ($this->listing instanceof Traversable)
3✔
74
            ? iterator_to_array($this->listing, false)
3✔
75
            : $this->listing;
3✔
76
    }
77
}
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