Completed
Pull Request — master (#3)
by
unknown
01:03
created

MakeMigration::getStub()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace BeyondCode\LaravelPackageTools\Commands;
4
5
use Illuminate\Support\Str;
6
7
class MakeMigration extends GeneratorCommand
8
{
9
    protected $type = 'Migration';
10
11
    protected function getStub()
12
    {
13
        return __DIR__.'/stubs/migration.stub';
14
    }
15
16
    protected function qualifyClass($name)
17
    {
18
        return $this->rootNamespace() . '\\..\\database\\migrations\\' . $name;
19
    }
20
21
    protected function replaceClass($stub, $name)
22
    {
23
        $stub = str_replace('CreateDummiesTable', $this->getClassName($stub, $name), $stub);
24
25
        return str_replace('dummies', $this->option('create', 'table_name'), $stub);
26
    }
27
28
    protected function getClassName($stub, $name)
0 ignored issues
show
Unused Code introduced by
The parameter $stub is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    {
30
        $class = str_replace($this->getNamespace($name).'\\', '', $name);
31
        return ucfirst(Str::camel($class));
32
    }
33
}
34