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

orchestral / canvas / 3848713348

pending completion
3848713348

push

github

Mior Muhammad Zaki
Merge branch '7.x'

772 of 799 relevant lines covered (96.62%)

19.07 hits per line

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

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

3
namespace Orchestra\Canvas;
4

5
use Illuminate\Filesystem\Filesystem;
6
use Illuminate\Support\Arr;
7

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

21
        $preset = $config['preset'];
71✔
22

23
        switch ($preset) {
24
            case 'package':
71✔
25
                return new Core\Presets\Package($configuration, $basePath, $files);
1✔
26
            case 'laravel':
70✔
27
                return new Core\Presets\Laravel($configuration, $basePath, $files);
70✔
28
            default:
29
                if (class_exists($preset)) {
×
30
                    /**
31
                     * @var class-string<\Orchestra\Canvas\Core\Presets\Preset> $preset
32
                     *
33
                     * @return \Orchestra\Canvas\Core\Presets\Preset
34
                     */
35
                    return new $preset($configuration, $basePath, $files);
×
36
                }
37

38
                return new Core\Presets\Laravel($configuration, $basePath, $files);
×
39
        }
40
    }
41
}
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