| Conditions | 13 |
| Paths | 3072 |
| Total Lines | 74 |
| Code Lines | 39 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
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 |
||
| 17 | public function up(Schema $schema): void |
||
| 18 | { |
||
| 19 | if ($schema->hasTable('skill_level')) { |
||
| 20 | $this->addSql( |
||
| 21 | 'ALTER TABLE skill_level CHANGE short_name short_title VARCHAR(255) NOT NULL' |
||
| 22 | ); |
||
| 23 | } |
||
| 24 | |||
| 25 | if ($schema->hasTable('c_chat_conversation')) { |
||
| 26 | $this->addSql( |
||
| 27 | 'ALTER TABLE c_chat_conversation CHANGE name title VARCHAR(255) NOT NULL' |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | if ($schema->hasTable('c_wiki_category')) { |
||
| 32 | $this->addSql( |
||
| 33 | 'ALTER TABLE c_wiki_category CHANGE name title VARCHAR(255) NOT NULL' |
||
| 34 | ); |
||
| 35 | } |
||
| 36 | |||
| 37 | if ($schema->hasTable('c_shortcut')) { |
||
| 38 | $this->addSql( |
||
| 39 | 'ALTER TABLE c_shortcut CHANGE name title VARCHAR(255) NOT NULL' |
||
| 40 | ); |
||
| 41 | } |
||
| 42 | |||
| 43 | if ($schema->hasTable('illustration')) { |
||
| 44 | $this->addSql( |
||
| 45 | 'ALTER TABLE illustration CHANGE name title VARCHAR(255) NOT NULL' |
||
| 46 | ); |
||
| 47 | } |
||
| 48 | |||
| 49 | if ($schema->hasTable('resource_type')) { |
||
| 50 | $this->addSql( |
||
| 51 | 'ALTER TABLE resource_type CHANGE name title VARCHAR(255) NOT NULL' |
||
| 52 | ); |
||
| 53 | } |
||
| 54 | |||
| 55 | if ($schema->hasTable('resource_format')) { |
||
| 56 | $this->addSql( |
||
| 57 | 'ALTER TABLE resource_format CHANGE name title VARCHAR(255) NOT NULL' |
||
| 58 | ); |
||
| 59 | } |
||
| 60 | |||
| 61 | if ($schema->hasTable('tool')) { |
||
| 62 | $table = $schema->getTable('tool'); |
||
| 63 | if ($table->hasIndex('UNIQ_20F33ED15E237E06')) { |
||
| 64 | $this->addSql( |
||
| 65 | 'DROP INDEX UNIQ_20F33ED15E237E06 on tool' |
||
| 66 | ); |
||
| 67 | } |
||
| 68 | $this->addSql( |
||
| 69 | 'ALTER TABLE tool CHANGE name title VARCHAR(255) NOT NULL' |
||
| 70 | ); |
||
| 71 | $this->addSql( |
||
| 72 | 'CREATE UNIQUE INDEX UNIQ_20F33ED12B36786B ON tool (title)' |
||
| 73 | ); |
||
| 74 | } |
||
| 75 | |||
| 76 | if ($schema->hasTable('resource_tag')) { |
||
| 77 | $this->addSql( |
||
| 78 | 'ALTER TABLE resource_tag CHANGE name title VARCHAR(255) NOT NULL' |
||
| 79 | ); |
||
| 80 | } |
||
| 81 | |||
| 82 | if ($schema->hasTable('track_e_hotpotatoes')) { |
||
| 83 | $this->addSql( |
||
| 84 | 'ALTER TABLE track_e_hotpotatoes CHANGE exe_name title VARCHAR(255) NOT NULL' |
||
| 85 | ); |
||
| 86 | } |
||
| 87 | |||
| 88 | if ($schema->hasTable('lti_external_tool')) { |
||
| 89 | $this->addSql( |
||
| 90 | 'ALTER TABLE lti_external_tool CHANGE name title VARCHAR(255) NOT NULL' |
||
| 91 | ); |
||
| 163 |