@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function getStub() |
44 | 44 | { |
45 | - if ($this->option('model')) { |
|
45 | + if ( $this->option( 'model' ) ) { |
|
46 | 46 | return __DIR__ . '../../resources/stubs/transformer.model.stub'; |
47 | 47 | } |
48 | 48 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param string $rootNamespace |
56 | 56 | * @return string |
57 | 57 | */ |
58 | - protected function getDefaultNamespace($rootNamespace) |
|
58 | + protected function getDefaultNamespace( $rootNamespace ) |
|
59 | 59 | { |
60 | 60 | return $rootNamespace . '\Transformers'; |
61 | 61 | } |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | * @param string $name |
67 | 67 | * @return string |
68 | 68 | */ |
69 | - protected function buildClass($name) |
|
69 | + protected function buildClass( $name ) |
|
70 | 70 | { |
71 | - $replace = []; |
|
71 | + $replace = [ ]; |
|
72 | 72 | |
73 | - if ($this->option('model')) { |
|
74 | - $replace = $this->buildModelReplacements($replace); |
|
73 | + if ( $this->option( 'model' ) ) { |
|
74 | + $replace = $this->buildModelReplacements( $replace ); |
|
75 | 75 | } |
76 | 76 | |
77 | - return str_replace(array_keys($replace), array_values($replace), parent::buildClass($name)); |
|
77 | + return str_replace( array_keys( $replace ), array_values( $replace ), parent::buildClass( $name ) ); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -83,15 +83,15 @@ discard block |
||
83 | 83 | * @param array $replace |
84 | 84 | * @return array |
85 | 85 | */ |
86 | - protected function buildModelReplacements(array $replace) |
|
86 | + protected function buildModelReplacements( array $replace ) |
|
87 | 87 | { |
88 | - $model = $this->qualifyClass($this->option('model')); |
|
88 | + $model = $this->qualifyClass( $this->option( 'model' ) ); |
|
89 | 89 | |
90 | - return array_merge($replace, [ |
|
90 | + return array_merge( $replace, [ |
|
91 | 91 | 'DummyFullModelClass' => $model, |
92 | - 'DummyModelClass' => class_basename($model), |
|
93 | - 'DummyModelVariable' => lcfirst(class_basename($model)), |
|
94 | - ]); |
|
92 | + 'DummyModelClass' => class_basename( $model ), |
|
93 | + 'DummyModelVariable' => lcfirst( class_basename( $model ) ), |
|
94 | + ] ); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | protected function getOptions() |
103 | 103 | { |
104 | 104 | return [ |
105 | - ['model', 'm', InputOption::VALUE_OPTIONAL, 'Generate a model transformerl.'], |
|
105 | + [ 'model', 'm', InputOption::VALUE_OPTIONAL, 'Generate a model transformerl.' ], |
|
106 | 106 | ]; |
107 | 107 | } |
108 | 108 | } |
109 | 109 | \ No newline at end of file |