Conditions | 6 |
Paths | 18 |
Total Lines | 26 |
Code Lines | 9 |
Lines | 14 |
Ratio | 53.85 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function setComments(OracleBlueprint $blueprint) |
||
28 | { |
||
29 | // Comment set by $table->comment('comment'); |
||
30 | if ($blueprint->commentTable != null) |
||
31 | { |
||
32 | $this->connection->statement(sprintf('comment on table %s is \'%s\'', $blueprint->getTable(), $blueprint->commentTable)); |
||
33 | } |
||
34 | |||
35 | // Comments set by $table->string('column')->comment('comment'); |
||
36 | View Code Duplication | foreach ($blueprint->getColumns() as $column) |
|
|
|||
37 | { |
||
38 | if (isset($column['comment'])) |
||
39 | { |
||
40 | $this->connection->statement(sprintf('comment on column %s.%s is \'%s\'', $blueprint->getTable(), $column['name'], $column['comment'])); |
||
41 | } |
||
42 | } |
||
43 | |||
44 | // Comments set by $table->commentColumn('column', 'comment'); |
||
45 | View Code Duplication | foreach ($blueprint->commentColumn as $column) |
|
46 | { |
||
47 | if (isset($column['comment'])) |
||
48 | { |
||
49 | $this->connection->statement(sprintf('comment on column %s.%s is \'%s\'', $blueprint->getTable(), $column['name'], $column['comment'])); |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 | } |
||
54 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.