Completed
Push — dev ( 6d8737...fe3822 )
by Zach
02:19
created

DBSeed::handle()   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 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Yarak\Commands;
4
5
use Yarak\DB\Seeders\SeedRunner;
6
use Symfony\Component\Console\Input\InputArgument;
7
8
class DBSeed extends YarakCommand
9
{
10
    /**
11
     * Configure the command.
12
     */
13
    protected function configure()
14
    {
15
        $this->setName('db:seed')
16
            ->setDescription('Seed the database.')
17
            ->setHelp('This command will run the given seeder class.')
18
            ->addArgument(
19
                'class',
20
                InputArgument::OPTIONAL,
21
                'The name of the seeder class to run.',
22
                'DatabaseSeeder'
23
            );
24
    }
25
26
    /**
27
     * Handle the command.
28
     */
29
    protected function handle()
30
    {
31
        $seedRunner = new SeedRunner($this->getOutput());
32
33
        $seedRunner->run($this->argument('class'));
1 ignored issue
show
Bug introduced by
It seems like $this->argument('class') targeting Yarak\Console\Command::argument() can also be of type array; however, Yarak\DB\Seeders\SeedRunner::run() does only seem to accept string, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
34
    }
35
}
36