Conditions | 9 |
Paths | 9 |
Total Lines | 51 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
50 | public function handle() |
||
51 | { |
||
52 | assert($this->creator instanceof MigrationCreator); |
||
53 | |||
54 | if ($this->useFallback()) { |
||
55 | $this->creator->setIlluminateCustomStubPath(); |
||
56 | parent::handle(); |
||
57 | return; |
||
58 | } |
||
59 | |||
60 | $this->creator->setArangoCustomStubPath(); |
||
61 | |||
62 | // It's possible for the developer to specify the tables to modify in this |
||
63 | // schema operation. The developer may also specify if this table needs |
||
64 | // to be freshly created so we can create the appropriate migrations. |
||
65 | $name = Str::snake(trim((string) $this->input->getArgument('name'))); |
||
66 | |||
67 | $table = $this->input->getOption('table'); |
||
68 | |||
69 | $create = $this->input->getOption('create') ?: false; |
||
70 | |||
71 | $edge = $this->input->getOption('edge') ?: false; |
||
72 | |||
73 | // If no table was given as an option but a create option is given then we |
||
74 | // will use the "create" option as the table name. This allows the devs |
||
75 | // to pass a table name into this option as a short-cut for creating. |
||
76 | if (!$table && is_string($create)) { |
||
77 | $table = $create; |
||
78 | |||
79 | $create = true; |
||
80 | } |
||
81 | |||
82 | if (!$table && is_string($edge)) { |
||
83 | $table = $create; |
||
84 | |||
85 | $edge = true; |
||
86 | } |
||
87 | |||
88 | // Next, we will attempt to guess the table name if this the migration has |
||
89 | // "create" in the name. This will allow us to provide a convenient way |
||
90 | // of creating migrations that create new tables for the application. |
||
91 | if (!$table) { |
||
92 | [$table, $create] = TableGuesser::guess($name); |
||
93 | } |
||
94 | |||
95 | // Now we are ready to write the migration out to disk. Once we've written |
||
96 | // the migration out, we will dump-autoload for the entire framework to |
||
97 | // make sure that the migrations are registered by the class loaders. |
||
98 | $this->writeMigration($name, $table, $create, $edge); |
||
99 | |||
100 | $this->composer->dumpAutoloads(); |
||
101 | } |
||
139 |
This property has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.