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

plank / laravel-mediable / 8585433686

07 Apr 2024 02:04AM UTC coverage: 95.282% (-0.5%) from 95.789%
8585433686

push

github

web-flow
Merge pull request #343 from plank/v6

V6

338 of 375 new or added lines in 30 files covered. (90.13%)

1 existing line in 1 file now uncovered.

1434 of 1505 relevant lines covered (95.28%)

117.76 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✔
NEW
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

© 2026 Coveralls, Inc