@@ -134,13 +134,13 @@ |
||
134 | 134 | $escapement = new Escapement(); |
135 | 135 | $comments = ''; |
136 | 136 | foreach ($this->table->getColumns() as $column) { |
137 | - $columnDescription = $column->getDescription(); |
|
138 | - if (!empty($columnDescription)) { |
|
137 | + $columnDescription = $column->getDescription(); |
|
138 | + if (!empty($columnDescription)) { |
|
139 | 139 | $comments .= sprintf("COMMENT ON COLUMN %s.%s IS '%s';", |
140 | 140 | $escapement->escape($this->table->getQualifiedName()), |
141 | 141 | $escapement->escape($column->getName()), |
142 | 142 | $columnDescription); |
143 | - } |
|
143 | + } |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return $comments; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | foreach ($this->table->getConstraints() as $constraint) { |
63 | 63 | $sql .= ','; |
64 | 64 | if ($constraint instanceof PrimaryKey) { |
65 | - $sql .= (string) $constraint ; |
|
65 | + $sql .= (string) $constraint; |
|
66 | 66 | } elseif ($constraint instanceof ForeignKey) { |
67 | 67 | $sql .= sprintf('CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s (%s) MATCH SIMPLE ON UPDATE %s ON DELETE %s' |
68 | 68 | , $constraint->getName() |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | , $columnType |
118 | 118 | , $this->getTypeConstraints($column) |
119 | 119 | , $column->isNotNull() ? 'NOT NULL' : '' |
120 | - , null === $column->getDefault() ? '' : 'DEFAULT'. ' ' . $this->addQuotesIfNeeded($column, $column->getDefault()) |
|
120 | + , null === $column->getDefault() ? '' : 'DEFAULT' . ' ' . $this->addQuotesIfNeeded($column, $column->getDefault()) |
|
121 | 121 | ); |
122 | 122 | } |
123 | 123 |
@@ -10,11 +10,11 @@ |
||
10 | 10 | { |
11 | 11 | private $container; |
12 | 12 | |
13 | - /** |
|
14 | - * Constructor. |
|
15 | - * |
|
16 | - * @param Symfony\Component\DependencyInjection\ContainerInterface $container |
|
17 | - */ |
|
13 | + /** |
|
14 | + * Constructor. |
|
15 | + * |
|
16 | + * @param Symfony\Component\DependencyInjection\ContainerInterface $container |
|
17 | + */ |
|
18 | 18 | public function __construct(ContainerInterface $container) |
19 | 19 | { |
20 | 20 | $this->container = $container; |
@@ -7,10 +7,10 @@ |
||
7 | 7 | class Escapement implements EscapementInterface |
8 | 8 | { |
9 | 9 | /** |
10 | - * {@inheritdoc} |
|
11 | - */ |
|
12 | - public function escape($databaseObject) |
|
13 | - { |
|
10 | + * {@inheritdoc} |
|
11 | + */ |
|
12 | + public function escape($databaseObject) |
|
13 | + { |
|
14 | 14 | return '"' . str_replace('.', '"."', $databaseObject) . '"'; |
15 | - } |
|
15 | + } |
|
16 | 16 | } |
@@ -11,6 +11,6 @@ |
||
11 | 11 | */ |
12 | 12 | public function escape($databaseObject) |
13 | 13 | { |
14 | - return '"' . str_replace('.', '"."', $databaseObject) . '"'; |
|
14 | + return '"' . str_replace('.', '"."', $databaseObject) . '"'; |
|
15 | 15 | } |
16 | 16 | } |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | { |
10 | 10 | private $schemaName; |
11 | 11 | |
12 | - /** |
|
13 | - * Sets a schema name. |
|
14 | - * |
|
15 | - * @param string $schemaName Schema name. |
|
16 | - * |
|
17 | - * @return GetTablesCommand |
|
18 | - */ |
|
12 | + /** |
|
13 | + * Sets a schema name. |
|
14 | + * |
|
15 | + * @param string $schemaName Schema name. |
|
16 | + * |
|
17 | + * @return GetTablesCommand |
|
18 | + */ |
|
19 | 19 | public function setSchemaName($schemaName) |
20 | 20 | { |
21 | 21 | $this->schemaName = $schemaName; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | return $this; |
24 | 24 | } |
25 | 25 | |
26 | - /** |
|
27 | - * {@inheritdoc} |
|
28 | - */ |
|
26 | + /** |
|
27 | + * {@inheritdoc} |
|
28 | + */ |
|
29 | 29 | public function getSql() |
30 | 30 | { |
31 | 31 | $schemaCondition = null === $this->schemaName |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | return $sql; |
38 | 38 | } |
39 | 39 | |
40 | - /** |
|
41 | - * {@inheritdoc} |
|
42 | - */ |
|
40 | + /** |
|
41 | + * {@inheritdoc} |
|
42 | + */ |
|
43 | 43 | public function execute() |
44 | 44 | { |
45 | 45 | $this->preExecute(); |
@@ -8,12 +8,12 @@ |
||
8 | 8 | private $schemaName; |
9 | 9 | |
10 | 10 | /** |
11 | - * Sets a schema name. |
|
12 | - * |
|
13 | - * @param string $schemaName Schema name. |
|
14 | - * |
|
15 | - * @return SchemaExistsCommand |
|
16 | - */ |
|
11 | + * Sets a schema name. |
|
12 | + * |
|
13 | + * @param string $schemaName Schema name. |
|
14 | + * |
|
15 | + * @return SchemaExistsCommand |
|
16 | + */ |
|
17 | 17 | public function setName($schemaName) |
18 | 18 | { |
19 | 19 | $this->schemaName = $schemaName; |
@@ -73,13 +73,13 @@ |
||
73 | 73 | return $connection->execute($sql); |
74 | 74 | } |
75 | 75 | |
76 | - /** |
|
77 | - * Execute sql query with select intention. |
|
78 | - * |
|
79 | - * @param string $sql A sql query. |
|
80 | - * |
|
81 | - * @return array |
|
82 | - */ |
|
76 | + /** |
|
77 | + * Execute sql query with select intention. |
|
78 | + * |
|
79 | + * @param string $sql A sql query. |
|
80 | + * |
|
81 | + * @return array |
|
82 | + */ |
|
83 | 83 | public function query($sql) |
84 | 84 | { |
85 | 85 | $connection = $this->get('connection'); |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Rentgen\Schema; |
4 | 4 | |
5 | 5 | use Symfony\Component\DependencyInjection\ContainerInterface; |
6 | - |
|
7 | 6 | use Rentgen\Rentgen; |
8 | 7 | use Rentgen\Database\Column; |
9 | 8 | use Rentgen\Database\Constraint\ConstraintInterface; |