Completed
Push — dev ( 7f87b9...487b18 )
by Zach
02:10
created

DBSeed::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Yarak\Commands;
4
5
use Yarak\Config\Config;
6
use Yarak\DB\DirectoryCreator;
7
use Yarak\DB\Seeders\SeedRunner;
8
use Symfony\Component\Console\Input\InputArgument;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
class DBSeed extends YarakCommand
13
{
14
    /**
15
     * Configure the command.
16
     */
17
    protected function configure()
18
    {
19
        $this->setName('db:seed')
20
            ->setDescription('Seed the database.')
21
            ->setHelp('This command will run the given seeder class.')
22
            ->addArgument(
23
                'class',
24
                InputArgument::OPTIONAL,
25
                'The name of the seeder class to run.',
26
                'DatabaseSeeder'
27
            );
28
    }
29
30
    /**
31
     * Execute the command.
32
     *
33
     * @param InputInterface  $input
34
     * @param OutputInterface $output
35
     */
36
    protected function execute(InputInterface $input, OutputInterface $output)
37
    {
38
        $seedRunner = new SeedRunner();
39
40
        $seedRunner->run($input->getArgument('class'));
41
    }
42
}
43