-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommand
More file actions
35 lines (26 loc) · 674 Bytes
/
command
File metadata and controls
35 lines (26 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/php
<?php
require_once 'vendor/autoload.php';
use App\Commands\DefaultCommand;
use App\Commands\GreetCommand;
use App\Commands\PhinxCommand;
use Symfony\Component\Console\Application;
# Common Class to instanciate traits
class UseTraits {
use App\Core\Traits\Utils\StrictArrayValidators;
};
$useTraits = new UseTraits();
# Init command line application
$app = new Application();
# Register Commands
$allCommands = [
DefaultCommand::class,
PhinxCommand::class,
GreetCommand::class
];
$useTraits->childrenMustBeOfType($allCommands, ['string']);
foreach($allCommands as $command){
$app->add(new $command);
};
# Run Commands
$app->run();