Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Commands
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 get
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Celema\Quma;
6
7use Celema\Quma\Commands\Add;
8use Celema\Quma\Commands\CreateMigrationsTable;
9use Celema\Quma\Commands\Migrations;
10use Celema\Quma\Contract\MigrationFactory;
11use Closure;
12
13/** @api */
14class Commands
15{
16    /**
17     * The migration commands as lazy factories, for a console Runner:
18     * `new Runner(Commands::get($conn))` or `$runner->add(...)`.
19     *
20     * @param array<non-empty-string, Connection>|Connection $conn
21     * @param array<array-key, mixed> $options
22     *
23     * @return array<class-string, Closure(): object>
24     */
25    public static function get(
26        array|Connection $conn,
27        array $options = [],
28        ?MigrationFactory $migrationFactory = null,
29    ): array {
30        return [
31            Add::class => static fn(): Add => new Add($conn, $options),
32            CreateMigrationsTable::class => static fn(): CreateMigrationsTable => new CreateMigrationsTable(
33                $conn,
34                $options,
35            ),
36            Migrations::class => static fn(): Migrations => new Migrations($conn, $options, $migrationFactory),
37        ];
38    }
39}

Paths

Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once. Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

Commands->get
26        array|Connection $conn,
27        array $options = [],
28        ?MigrationFactory $migrationFactory = null,
29    ): array {
30        return [
31            Add::class => static fn(): Add => new Add($conn, $options),
32            CreateMigrationsTable::class => static fn(): CreateMigrationsTable => new CreateMigrationsTable(
33                $conn,
34                $options,
35            ),
36            Migrations::class => static fn(): Migrations => new Migrations($conn, $options, $migrationFactory),
37        ];
38    }
{closure:/workspace/celema/quma/src/Commands.php:31-31}
31            Add::class => static fn(): Add => new Add($conn, $options),
{closure:/workspace/celema/quma/src/Commands.php:32-35}
32            CreateMigrationsTable::class => static fn(): CreateMigrationsTable => new CreateMigrationsTable(
33                $conn,
34                $options,
35            ),
{closure:/workspace/celema/quma/src/Commands.php:36-36}
36            Migrations::class => static fn(): Migrations => new Migrations($conn, $options, $migrationFactory),