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

plank / laravel-mediable / 13689748990

06 Mar 2025 02:19AM UTC coverage: 94.72%. Remained the same
13689748990

push

github

web-flow
Fix template type definition in MediableCollection (#378)

1489 of 1572 relevant lines covered (94.72%)

153.81 hits per line

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

75.0
/src/SourceAdapters/StreamResourceAdapter.php
1
<?php
2
declare(strict_types=1);
3

4
namespace Plank\Mediable\SourceAdapters;
5

6
use GuzzleHttp\Psr7\Utils;
7
use Plank\Mediable\Exceptions\MediaUpload\ConfigurationException;
8

9
/**
10
 * Stream resource Adapter.
11
 *
12
 * Adapts a stream resource.
13
 */
14
class StreamResourceAdapter extends StreamAdapter
15
{
16
    /**
17
     * @var resource
18
     */
19
    protected $resource;
20

21
    /**
22
     * Constructor.
23
     * @param resource $source
24
     * @throws ConfigurationException
25
     */
26
    public function __construct($source)
27
    {
28
        if (!is_resource($source) || get_resource_type($source) !== 'stream') {
42✔
29
            throw ConfigurationException::invalidSource("Invalid stream resource");
×
30
        }
31

32
        parent::__construct(Utils::streamFor($source));
42✔
33

34
        $this->resource = $source;
30✔
35
    }
36
}
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

© 2025 Coveralls, Inc