• 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/Exceptions/MediaUpload/ConfigurationException.php
1
<?php
2
declare(strict_types=1);
3

4
namespace Plank\Mediable\Exceptions\MediaUpload;
5

6
use Plank\Mediable\Exceptions\MediaUploadException;
7

8
class ConfigurationException extends MediaUploadException
9
{
10
    public static function cannotSetAdapter(string $class): self
11
    {
12
        return new self("Could not set adapter of class `{$class}`. Must implement `\Plank\Mediable\SourceAdapters\SourceAdapterInterface`.");
12✔
13
    }
14

15
    public static function cannotSetModel(string $class): self
16
    {
17
        return new self("Could not set `{$class}` as Media model class. Must extend `\Plank\Mediable\Media`.");
6✔
18
    }
19

20
    public static function noSourceProvided(): self
21
    {
22
        return new self('No source provided for upload.');
6✔
23
    }
24

25
    public static function unrecognizedSource($source): self
26
    {
27
        if (is_object($source)) {
12✔
28
            $source = get_class($source);
6✔
29
        } elseif (is_resource($source)) {
6✔
30
            $source = get_resource_type($source);
×
31
        }
32

33
        return new self("Could not recognize source, `{$source}` provided.");
12✔
34
    }
35

36
    public static function invalidSource(string $message, \Throwable $original = null): self
37
    {
38
        return new self("Invalid source provided. {$message}", 0, $original);
42✔
39
    }
40

41
    public static function diskNotFound(string $disk): self
42
    {
43
        return new self("Cannot find disk named `{$disk}`.");
6✔
44
    }
45

46
    public static function cannotInferFilename(): self
47
    {
NEW
48
        return new self('No filename is provided and cannot infer filename from the provided source.');
×
49
    }
50

51
    public static function invalidOptimizer(string $optimizerClass): self
52
    {
NEW
53
        return new self("Invalid optimizer class `{$optimizerClass}`. Must implement `\Spatie\ImageOptimizer\Optimizer`.");
×
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