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

eliashaeussler / cache-warmup / 12420805923

19 Dec 2024 09:08PM UTC coverage: 90.346% (-0.3%) from 90.625%
12420805923

push

github

web-flow
Merge pull request #425 from eliashaeussler/task/null-stream

[!!!][TASK] Switch to PSR-7 stream implementation for `NullStream`

19 of 24 new or added lines in 2 files covered. (79.17%)

1619 of 1792 relevant lines covered (90.35%)

10.13 hits per line

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

81.48
/src/Http/Message/Stream/NullStream.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the Composer package "eliashaeussler/cache-warmup".
7
 *
8
 * Copyright (C) 2020-2024 Elias Häußler <elias@haeussler.dev>
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation, either version 3 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22
 */
23

24
namespace EliasHaeussler\CacheWarmup\Http\Message\Stream;
25

26
use Psr\Http\Message;
27

28
use function strlen;
29

30
/**
31
 * NullStream.
32
 *
33
 * @author Elias Häußler <elias@haeussler.dev>
34
 * @license GPL-3.0-or-later
35
 */
36
final class NullStream implements Message\StreamInterface
37
{
38
    public function __toString(): string
1✔
39
    {
40
        return '';
1✔
41
    }
42

NEW
43
    public function close(): void {}
×
44

45
    public function detach()
1✔
46
    {
47
        return null;
1✔
48
    }
49

50
    public function getSize(): int
1✔
51
    {
52
        return 0;
1✔
53
    }
54

NEW
55
    public function tell(): int
×
56
    {
NEW
57
        return 0;
×
58
    }
59

60
    public function eof(): bool
1✔
61
    {
62
        return true;
1✔
63
    }
64

65
    public function isSeekable(): bool
1✔
66
    {
67
        return true;
1✔
68
    }
69

NEW
70
    public function seek(int $offset, int $whence = SEEK_SET): void {}
×
71

NEW
72
    public function rewind(): void {}
×
73

74
    public function isWritable(): bool
1✔
75
    {
76
        return true;
1✔
77
    }
78

79
    public function write(string $string): int
1✔
80
    {
81
        return strlen($string);
1✔
82
    }
83

84
    public function isReadable(): bool
1✔
85
    {
86
        return true;
1✔
87
    }
88

89
    public function read(int $length): string
1✔
90
    {
91
        return '';
1✔
92
    }
93

94
    public function getContents(): string
1✔
95
    {
96
        return '';
1✔
97
    }
98

99
    /**
100
     * @return array{}|null
101
     */
102
    public function getMetadata(?string $key = null): ?array
2✔
103
    {
104
        return null !== $key ? null : [];
2✔
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