| Conditions | 1 |
| Paths | 1 |
| Total Lines | 64 |
| Code Lines | 51 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 |
||
| 29 | public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
||
| 30 | /** @var Schema $schema */ |
||
| 31 | $schema = $schemaClosure(); |
||
| 32 | |||
| 33 | $table = $schema->getTable('jobs'); |
||
| 34 | $column = $table->getColumn('id'); |
||
| 35 | $column->setUnsigned(true); |
||
| 36 | |||
| 37 | $table = $schema->getTable('authtoken'); |
||
| 38 | $column = $table->getColumn('id'); |
||
| 39 | $column->setUnsigned(true); |
||
| 40 | $column = $table->getColumn('type'); |
||
| 41 | $column->setUnsigned(true); |
||
| 42 | $column = $table->getColumn('remember'); |
||
| 43 | $column->setUnsigned(true); |
||
| 44 | $column = $table->getColumn('last_activity'); |
||
| 45 | $column->setUnsigned(true); |
||
| 46 | $column = $table->getColumn('last_check'); |
||
| 47 | $column->setUnsigned(true); |
||
| 48 | |||
| 49 | $table = $schema->getTable('bruteforce_attempts'); |
||
| 50 | $column = $table->getColumn('id'); |
||
| 51 | $column->setUnsigned(true); |
||
| 52 | $column = $table->getColumn('occurred'); |
||
| 53 | $column->setUnsigned(true); |
||
| 54 | |||
| 55 | $table = $schema->getTable('comments'); |
||
| 56 | $column = $table->getColumn('id'); |
||
| 57 | $column->setUnsigned(true); |
||
| 58 | $column = $table->getColumn('parent_id'); |
||
| 59 | $column->setUnsigned(true); |
||
| 60 | $column = $table->getColumn('topmost_parent_id'); |
||
| 61 | $column->setUnsigned(true); |
||
| 62 | $column = $table->getColumn('children_count'); |
||
| 63 | $column->setUnsigned(true); |
||
| 64 | |||
| 65 | $table = $schema->getTable('file_locks'); |
||
| 66 | $column = $table->getColumn('id'); |
||
| 67 | $column->setUnsigned(true); |
||
| 68 | |||
| 69 | $table = $schema->getTable('systemtag'); |
||
| 70 | $column = $table->getColumn('id'); |
||
| 71 | $column->setUnsigned(true); |
||
| 72 | |||
| 73 | $table = $schema->getTable('systemtag_object_mapping'); |
||
| 74 | $column = $table->getColumn('systemtagid'); |
||
| 75 | $column->setUnsigned(true); |
||
| 76 | |||
| 77 | $table = $schema->getTable('systemtag_group'); |
||
| 78 | $column = $table->getColumn('systemtagid'); |
||
| 79 | $column->setUnsigned(true); |
||
| 80 | |||
| 81 | $table = $schema->getTable('vcategory'); |
||
| 82 | $column = $table->getColumn('id'); |
||
| 83 | $column->setUnsigned(true); |
||
| 84 | |||
| 85 | $table = $schema->getTable('vcategory_to_object'); |
||
| 86 | $column = $table->getColumn('objid'); |
||
| 87 | $column->setUnsigned(true); |
||
| 88 | $column = $table->getColumn('categoryid'); |
||
| 89 | $column->setUnsigned(true); |
||
| 90 | |||
| 91 | return $schema; |
||
| 92 | } |
||
| 93 | |||
| 103 |