ModuleConfig   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 59
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 56 1
1
<?php
2
/**
3
 * Reddogs (https://github.com/reddogs-at)
4
 *
5
 * @see https://github.com/reddogs-at/reddogs-doctrine-migrations for the canonical source repository
6
 * @license https://github.com/reddogs-at/reddogs-doctrine-migrations/blob/master/LICENSE MIT License
7
 */
8
namespace Reddogs\Doctrine\Migrations;
9
10
class ModuleConfig
11
{
12
    public function __invoke()
13
    {
14
        return [
15
            'console_routes' => [
16
                'mogrations:execute' => [
17
                    'name' => 'mogrations:execute',
18
                    'route' => 'mogrations:execute <moduleName> [--version=] [--write-sql] [--dry-run] [--up] [--down] [--query-time] ' .
19
                               '[--quiet|-q] [--no-interaction|-n] [--verbose|-v|-vv|-vvv]',
20
                    'handler' => ExecuteCommand::class,
21
                    'short_description' => 'Execute single module migration up or down',
22
                ],
23
24
                'mogrations:generate' =>  [
25
                    'name' => 'mogrations:generate',
26
                    'route' => 'mogrations:generate <moduleName> [--quiet|-q] [--no-interaction|-n] [--verbose|-v|-vv|-vvv]',
27
                    'short_description' => 'Generate new blank module migration class',
28
                    'handler' => GenerateCommand::class,
29
                ],
30
                'mogrations:latest' => [
31
                    'name' => 'mogrations:latest',
32
                    'route' => 'mogrations:latest <moduleName>',
33
                    'handler' => LatestCommand::class,
34
                    'short_description' => 'Output the latest module migration version number',
35
                ],
36
                'mogrations:migrate' =>  [
37
                    'name' => 'mogrations:migrate',
38
                    'route' => 'mogrations:migrate <moduleName> [--version=] [--dry-run] [--write-sql] [--query-time] ' .
39
                               '[--quiet|-q] [--no-interaction|-n] [--verbose|-v|-vv|-vvv]',
40
                    'short_description' => 'Execute a module migration to a specified version or the latest available version',
41
                    'handler' => MigrateCommand::class,
42
                ],
43
                'mogrations:migrate-all' => [
44
                    'name' => 'mogrations:migrate-all',
45
                    'route' => 'mogrations:migrate-all',
46
                    'short_description' => 'Migrate all registered module migrations',
47
                    'handler' => MigrateAllCommand::class,
48
                ],
49
                'mogrations:status' => [
50
                    'name' => 'mogrations:status',
51
                    'route' => 'mogrations:status <moduleName>',
52
                    'handler' => StatusCommand::class,
53
                    'short_description' => 'View the status of a set of module migrations'
54
                ],
55
            ],
56
            'dependencies' => [
57
                'factories' => [
58
                    ExecuteCommand::class => CommandFactory::class,
59
                    GenerateCommand::class => CommandFactory::class,
60
                    LatestCommand::class => CommandFactory::class,
61
                    MigrateCommand::class => CommandFactory::class,
62
                    MigrateAllCommand::class => MigrateAllCommandFactory::class,
63
                    StatusCommand::class => CommandFactory::class,
64
                ]
65
            ]
66
        ];
67
    }
68
}
69
70