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

polymorphine / message / #21

04 Dec 2022 11:48AM UTC coverage: 100.0%. Remained the same
#21

push

php-coveralls

shudd3r
Fixed error for HTTP/2.0 protocol signature

Protocol name according to RFC standards should be HTTP/2,
but webservers also use HTTP/2.0

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

473 of 473 relevant lines covered (100.0%)

17.83 hits per line

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

100.0
/src/NonSAPIUploadedFile.php
1
<?php declare(strict_types=1);
2

3
/*
4
 * This file is part of Polymorphine/Message package.
5
 *
6
 * (c) Shudd3r <q3.shudder@gmail.com>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11

12
namespace Polymorphine\Message;
13

14
use RuntimeException;
15

16

17
class NonSAPIUploadedFile extends UploadedFile
18
{
19
    protected function moveFile($source, $target): void
20
    {
21
        $directory = dirname($target);
2✔
22
        if (!is_dir($directory) || !is_writeable($directory)) {
2✔
23
            throw new RuntimeException('Cannot write into target directory');
1✔
24
        }
25

26
        $targetStream = Stream::fromResourceUri($target, 'w+b');
1✔
27

28
        $this->stream->rewind();
1✔
29
        while (!$this->stream->eof()) {
1✔
30
            $targetStream->write($this->stream->read(4096));
1✔
31
        }
32

33
        $targetStream->close();
1✔
34
        $this->stream->close();
1✔
35

36
        if (is_file($source)) { unlink($source); }
1✔
37
    }
38
}
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