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

orchestral / workbench / 9256074278

27 May 2024 01:57PM UTC coverage: 97.5% (-1.7%) from 99.153%
9256074278

push

github

crynobone
Merge branch '8.x' into 9.x

1 of 3 new or added lines in 1 file covered. (33.33%)

117 of 120 relevant lines covered (97.5%)

7.61 hits per line

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

87.5
/src/BuildParser.php
1
<?php
2

3
namespace Orchestra\Workbench;
4

5
use Illuminate\Support\Collection;
6

7
class BuildParser
8
{
9
    /**
10
     * Get Workbench build steps.
11
     *
12
     * @param  array<int|string, array<string, mixed>|string>  $config
13
     * @return \Illuminate\Support\Collection<string, array<string, mixed>>
14
     */
15
    public static function make(array $config): Collection
16
    {
17
        return Collection::make($config)
1✔
18
            ->mapWithKeys(static function (array|string $build) {
1✔
19
                /** @var string $name */
20
                $name = match (true) {
1✔
21
                    \is_array($build) => array_key_first($build),
1✔
22
                    \is_string($build) => $build,
1✔
23
                };
1✔
24

25
                /** @var array<string, mixed> $options */
26
                $options = match (true) {
1✔
27
                    \is_array($build) => $build[array_key_first($build)],
1✔
28
                    \is_string($build) => [],
1✔
29
                };
1✔
30

31
                return [
1✔
32
                    $name => Collection::make($options)->mapWithKeys(static fn ($value, $key) => [$key => $value])->all(),
1✔
33
                ];
1✔
34
            });
1✔
35
    }
36

37
    /**
38
     * Resolve command options.
39
     */
40
    protected static function resolveOptions(array $options): array
41
    {
NEW
42
        var_dump($options);
×
NEW
43
        return array_shift($options);
×
44
    }
45
}
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