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

orchestral / canvas / 13226378755

09 Feb 2025 01:58PM UTC coverage: 94.33% (+0.2%) from 94.118%
13226378755

push

github

crynobone
wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

4 of 5 new or added lines in 1 file covered. (80.0%)

732 of 776 relevant lines covered (94.33%)

32.65 hits per line

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

83.33
/src/Canvas.php
1
<?php
2

3
namespace Orchestra\Canvas;
4

5
use Illuminate\Support\Arr;
6

7
class Canvas
8
{
9
    /**
10
     * Make Preset from configuration.
11
     *
12
     * @param  array<string, mixed>  $config
13
     */
14
    public static function preset(array $config, string $basePath): Presets\Preset
15
    {
16
        /** @var array<string, mixed> $configuration */
17
        $configuration = Arr::except($config, 'preset');
85✔
18

19
        $preset = $config['preset'] ?? 'laravel';
85✔
20

21
        return match (true) {
22
            $preset === 'package' => new Presets\Package($configuration, $basePath),
85✔
23
            $preset === 'laravel' => new Presets\Laravel($configuration, $basePath),
84✔
NEW
24
            class_exists($preset) => new $preset($configuration, $basePath),
×
25
            default => throw new InvalidArgumentException(sprintf('Unable to resolve %s preset', $preset)),
85✔
26
        };
27
    }
28
}
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