• 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/DataUrlAdapter.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
 * Adapts a string containing an RFC2397 Data URL.
11
 */
12
class DataUrlAdapter extends StreamAdapter
13
{
14
    public function __construct(string $source)
15
    {
16
        $source = preg_replace('/^data:\/?\/?/', 'data://', $source, -1, $count);
18✔
17
        if ($count === 0) {
18✔
NEW
18
            throw ConfigurationException::invalidSource('Invalid Data URL');
×
19
        }
20
        parent::__construct(Utils::streamFor(Utils::tryFopen($source, 'rb')));
18✔
21
    }
22
}
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