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

tempestphp / tempest-framework / 14049246919

24 Mar 2025 09:42PM UTC coverage: 79.353% (-0.04%) from 79.391%
14049246919

push

github

web-flow
feat(support): support array parameters in string manipulations (#1073)

48 of 48 new or added lines in 2 files covered. (100.0%)

735 existing lines in 126 files now uncovered.

10492 of 13222 relevant lines covered (79.35%)

90.78 hits per line

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

83.33
/src/Tempest/Console/src/Input/MemoryInputBuffer.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Console\Input;
6

7
use Exception;
8
use Fiber;
9
use Tempest\Console\InputBuffer;
10
use Tempest\Console\Key;
11

12
final class MemoryInputBuffer implements InputBuffer
13
{
14
    private array $buffer = [];
15

16
    private ?Fiber $fiber = null;
17

18
    public function __construct() {}
172✔
19

20
    public function add(int|string|Key ...$input): void
70✔
21
    {
22
        foreach ($input as $line) {
70✔
23
            $this->buffer[] = ($line instanceof Key)
70✔
24
                ? $line->value
4✔
25
                : ((string) $line);
67✔
26
        }
27

28
        $this->fiber?->resume();
70✔
29
    }
30

UNCOV
31
    public function read(int $bytes): string
×
32
    {
33
        return $this->consumeBuffer();
×
34
    }
35

36
    public function readln(): string
76✔
37
    {
38
        return $this->consumeBuffer();
76✔
39
    }
40

41
    private function consumeBuffer(): string
76✔
42
    {
43
        $this->fiber = Fiber::getCurrent();
76✔
44

45
        if (! $this->fiber?->isRunning()) {
76✔
UNCOV
46
            throw new Exception('No fiber running');
×
47
        }
48

49
        Fiber::suspend();
76✔
50

51
        $next = array_shift($this->buffer);
70✔
52

53
        return $next ?? '';
70✔
54
    }
55
}
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