| Conditions | 1 |
| Paths | 1 |
| Total Lines | 59 |
| 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 |
||
| 30 | public function configure(AbstractSchemaManager $schemaManager) |
||
| 31 | { |
||
| 32 | $schema = $schemaManager->createSchema(); |
||
| 33 | $table = $schema->createTable($this->tableName->toNative()); |
||
| 34 | |||
| 35 | $table->addColumn( |
||
| 36 | 'entity_id', |
||
| 37 | 'guid', |
||
| 38 | array('length' => 36, 'notnull' => true) |
||
| 39 | ); |
||
| 40 | $table->addColumn( |
||
| 41 | 'entity_type', |
||
| 42 | 'string', |
||
| 43 | array('length' => 36, 'notnull' => true) |
||
| 44 | ); |
||
| 45 | $table->addColumn( |
||
| 46 | 'title', |
||
| 47 | 'text' |
||
| 48 | ); |
||
| 49 | $table->addColumn( |
||
| 50 | 'uid', |
||
| 51 | 'guid', |
||
| 52 | array('length' => 36, 'notnull' => true) |
||
| 53 | ); |
||
| 54 | $table->addColumn( |
||
| 55 | 'zip', |
||
| 56 | 'string', |
||
| 57 | array('length' => 32) |
||
| 58 | ); |
||
| 59 | $table->addColumn( |
||
| 60 | 'country', |
||
| 61 | 'string', |
||
| 62 | array('length' => 2) |
||
| 63 | ); |
||
| 64 | $table->addColumn( |
||
| 65 | 'created', |
||
| 66 | 'string', |
||
| 67 | array('length' => 32, 'notnull' => true) |
||
| 68 | ); |
||
| 69 | $table->addColumn( |
||
| 70 | 'updated', |
||
| 71 | 'string', |
||
| 72 | array('length' => 32, 'notnull' => true) |
||
| 73 | ); |
||
| 74 | $table->addColumn( |
||
| 75 | 'owning_domain', |
||
| 76 | 'string', |
||
| 77 | array('length' => 256, 'notnull' => true) |
||
| 78 | ); |
||
| 79 | $table->addColumn( |
||
| 80 | 'entity_iri', |
||
| 81 | 'string', |
||
| 82 | array('length' => 256) |
||
| 83 | ); |
||
| 84 | |||
| 85 | $table->setPrimaryKey(['entity_id']); |
||
| 86 | |||
| 87 | $schemaManager->createTable($table); |
||
| 88 | } |
||
| 89 | } |
||
| 90 |