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

orchestral / canvas / 6047542927

01 Sep 2023 09:03AM UTC coverage: 94.11% (-0.2%) from 94.316%
6047542927

push

github

crynobone
Merge remote-tracking branch 'origin/master'

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

751 of 798 relevant lines covered (94.11%)

22.82 hits per line

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

87.5
/src/Concerns/ResolvesPresetStubs.php
1
<?php
2

3
namespace Orchestra\Canvas\Concerns;
4

5
use Orchestra\Canvas\Core\Presets\Preset;
6

7
trait ResolvesPresetStubs
8
{
9
    /**
10
     * Get the stub file for the preset.
11
     */
12
    public function getStubFileFromPresetStorage(Preset $preset, string $filename): string
13
    {
14
        $directory = $this->getPresetStorage($preset);
84✔
15

16
        if (file_exists("{$directory}/{$filename}")) {
84✔
17
            return "{$directory}/{$filename}";
×
18
        }
19

20
        return __DIR__."/../../storage/laravel/{$filename}";
84✔
21
    }
22

23
    /**
24
     * Get the stub storage for the preset.
25
     */
26
    public function getPresetStorage(Preset $preset): ?string
27
    {
28
        return $preset->hasCustomStubPath()
84✔
29
            ? $preset->getCustomStubPath()
78✔
30
            : $this->getDefaultPresetStorage($preset);
84✔
31
    }
32

33
    /**
34
     * Get the default stub storage for the preset.
35
     */
36
    public function getDefaultPresetStorage(Preset $preset): string
37
    {
38
        return __DIR__."/../../storage/{$preset->name()}";
6✔
39
    }
40
}
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

© 2025 Coveralls, Inc