Passed
Branch tests-better-coverage (039fc0)
by Michael
09:41
created
lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         } catch (DBALException $exception) {
54 54
             $exception = $exception->getPrevious();
55 55
 
56
-            if (! $exception instanceof DriverException) {
56
+            if ( ! $exception instanceof DriverException) {
57 57
                 throw $exception;
58 58
             }
59 59
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $length = (int) $tableColumn['length'];
90 90
         $default = $tableColumn['default'];
91 91
 
92
-        if (!isset($tableColumn['name'])) {
92
+        if ( ! isset($tableColumn['name'])) {
93 93
             $tableColumn['name'] = '';
94 94
         }
95 95
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type);
126 126
 
127 127
         $options = [
128
-            'length'        => ($length == 0 || !in_array($type, ['text', 'string'])) ? null : $length,
128
+            'length'        => ($length == 0 || ! in_array($type, ['text', 'string'])) ? null : $length,
129 129
             'unsigned'      => false,
130 130
             'fixed'         => (bool) $fixed,
131 131
             'default'       => $default !== 'NULL' ? $default : null,
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     /**
177 177
      * {@inheritdoc}
178 178
      */
179
-    protected function _getPortableTableIndexesList($tableIndexRows, $tableName=null)
179
+    protected function _getPortableTableIndexesList($tableIndexRows, $tableName = null)
180 180
     {
181 181
         foreach ($tableIndexRows as &$tableIndex) {
182 182
             $tableIndex['non_unique'] = (boolean) $tableIndex['non_unique'];
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             ON Tab.[ID] = Sysobjects.[Parent_Obj]
297 297
             INNER JOIN sys.default_constraints DefCons ON DefCons.[object_id] = Sysobjects.[ID]
298 298
             INNER JOIN SysColumns Col ON Col.[ColID] = DefCons.[parent_column_id] AND Col.[ID] = Tab.[ID]
299
-            WHERE Col.[Name] = " . $this->_conn->quote($column) ." AND Tab.[Name] = " . $this->_conn->quote($table) . "
299
+            WHERE Col.[Name] = " . $this->_conn->quote($column) . " AND Tab.[Name] = " . $this->_conn->quote($table) . "
300 300
             ORDER BY Col.[Name]";
301 301
     }
302 302
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         }
250 250
 
251 251
         return array_values(
252
-            array_filter($assetNames, function ($assetName) use ($filterExpr) {
252
+            array_filter($assetNames, function($assetName) use ($filterExpr) {
253 253
                 $assetName = ($assetName instanceof AbstractAsset) ? $assetName->getName() : $assetName;
254 254
 
255 255
                 return preg_match($filterExpr, $assetName);
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
      */
451 451
     public function createTable(Table $table)
452 452
     {
453
-        $createFlags = AbstractPlatform::CREATE_INDEXES|AbstractPlatform::CREATE_FOREIGNKEYS;
453
+        $createFlags = AbstractPlatform::CREATE_INDEXES | AbstractPlatform::CREATE_FOREIGNKEYS;
454 454
         $this->_execSql($this->_platform->getCreateTableSQL($table, $createFlags));
455 455
     }
456 456
 
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
      *
858 858
      * @return array
859 859
      */
860
-    protected function _getPortableTableIndexesList($tableIndexRows, $tableName=null)
860
+    protected function _getPortableTableIndexesList($tableIndexRows, $tableName = null)
861 861
     {
862 862
         $result = [];
863 863
         foreach ($tableIndexRows as $tableIndex) {
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
             }
868 868
             $keyName = strtolower($keyName);
869 869
 
870
-            if (!isset($result[$keyName])) {
870
+            if ( ! isset($result[$keyName])) {
871 871
                 $result[$keyName] = [
872 872
                     'name' => $indexName,
873 873
                     'columns' => [$tableIndex['column_name']],
@@ -1069,10 +1069,10 @@  discard block
 block discarded – undo
1069 1069
         }
1070 1070
 
1071 1071
         $params = $this->_conn->getParams();
1072
-        if (! isset($params['defaultTableOptions'])) {
1072
+        if ( ! isset($params['defaultTableOptions'])) {
1073 1073
             $params['defaultTableOptions'] = [];
1074 1074
         }
1075
-        if (! isset($params['defaultTableOptions']['charset']) && isset($params['charset'])) {
1075
+        if ( ! isset($params['defaultTableOptions']['charset']) && isset($params['charset'])) {
1076 1076
             $params['defaultTableOptions']['charset'] = $params['charset'];
1077 1077
         }
1078 1078
         $schemaConfig->setDefaultTableOptions($params['defaultTableOptions']);
@@ -1123,6 +1123,6 @@  discard block
 block discarded – undo
1123 1123
      */
1124 1124
     public function removeDoctrineTypeFromComment($comment, $type)
1125 1125
     {
1126
-        return str_replace('(DC2Type:'.$type.')', '', $comment);
1126
+        return str_replace('(DC2Type:' . $type . ')', '', $comment);
1127 1127
     }
1128 1128
 }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Schema/AbstractAsset.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -226,9 +226,9 @@
 block discarded – undo
226 226
      *
227 227
      * @return string
228 228
      */
229
-    protected function _generateIdentifierName($columnNames, $prefix='', $maxSize=30)
229
+    protected function _generateIdentifierName($columnNames, $prefix = '', $maxSize = 30)
230 230
     {
231
-        $hash = implode("", array_map(function ($column) {
231
+        $hash = implode("", array_map(function($column) {
232 232
             return dechex(crc32($column));
233 233
         }, $columnNames));
234 234
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Schema/Visitor/Graphviz.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
46 46
     {
47 47
         $this->output .= $this->createNodeRelation(
48
-            $fkConstraint->getLocalTableName() . ":col" . current($fkConstraint->getLocalColumns()).":se",
49
-            $fkConstraint->getForeignTableName() . ":col" . current($fkConstraint->getForeignColumns()).":se",
48
+            $fkConstraint->getLocalTableName() . ":col" . current($fkConstraint->getLocalColumns()) . ":se",
49
+            $fkConstraint->getForeignTableName() . ":col" . current($fkConstraint->getForeignColumns()) . ":se",
50 50
             [
51 51
                 'dir'       => 'back',
52 52
                 'arrowtail' => 'dot',
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $this->output  = 'digraph "' . sha1(mt_rand()) . '" {' . "\n";
64 64
         $this->output .= 'splines = true;' . "\n";
65 65
         $this->output .= 'overlap = false;' . "\n";
66
-        $this->output .= 'outputorder=edgesfirst;'."\n";
66
+        $this->output .= 'outputorder=edgesfirst;' . "\n";
67 67
         $this->output .= 'mindist = 0.6;' . "\n";
68 68
         $this->output .= 'sep = .2;' . "\n";
69 69
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             $label .= '<TD BORDER="0" ALIGN="LEFT" BGCOLOR="#eeeeec">';
104 104
             $label .= '<FONT COLOR="#2e3436" FACE="Helvetica" POINT-SIZE="12">' . $columnLabel . '</FONT>';
105 105
             $label .= '</TD><TD BORDER="0" ALIGN="LEFT" BGCOLOR="#eeeeec"><FONT COLOR="#2e3436" FACE="Helvetica" POINT-SIZE="10">' . strtolower($column->getType()) . '</FONT></TD>';
106
-            $label .= '<TD BORDER="0" ALIGN="RIGHT" BGCOLOR="#eeeeec" PORT="col'.$column->getName().'">';
106
+            $label .= '<TD BORDER="0" ALIGN="RIGHT" BGCOLOR="#eeeeec" PORT="col' . $column->getName() . '">';
107 107
             if ($table->hasPrimaryKey() && in_array($column->getName(), $table->getPrimaryKey()->getColumns())) {
108 108
                 $label .= "\xe2\x9c\xb7";
109 109
             }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Schema/Schema.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     public function getTable($tableName)
197 197
     {
198 198
         $tableName = $this->getFullQualifiedAssetName($tableName);
199
-        if (!isset($this->_tables[$tableName])) {
199
+        if ( ! isset($this->_tables[$tableName])) {
200 200
             throw SchemaException::tableDoesNotExist($tableName);
201 201
         }
202 202
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
     public function getSequence($sequenceName)
296 296
     {
297 297
         $sequenceName = $this->getFullQualifiedAssetName($sequenceName);
298
-        if (!$this->hasSequence($sequenceName)) {
298
+        if ( ! $this->hasSequence($sequenceName)) {
299 299
             throw SchemaException::sequenceDoesNotExist($sequenceName);
300 300
         }
301 301
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
      *
396 396
      * @return \Doctrine\DBAL\Schema\Sequence
397 397
      */
398
-    public function createSequence($sequenceName, $allocationSize=1, $initialValue=1)
398
+    public function createSequence($sequenceName, $allocationSize = 1, $initialValue = 1)
399 399
     {
400 400
         $seq = new Sequence($sequenceName, $allocationSize, $initialValue);
401 401
         $this->_addSequence($seq);
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         $tableColumn['COLUMN_COMMENT'] = $this->removeDoctrineTypeFromComment($tableColumn['COLUMN_COMMENT'], $type);
44 44
 
45 45
         $options = [
46
-            'notnull' => !(bool) $tableColumn['IS_NULLABLE'],
46
+            'notnull' => ! (bool) $tableColumn['IS_NULLABLE'],
47 47
             'length' => (int) $tableColumn['CHARACTER_MAXIMUM_LENGTH'],
48 48
             'default' => $tableColumn['COLUMN_DEFAULT'] ?? null,
49 49
             'autoincrement' => (bool) $tableColumn['IS_AUTO_INCREMENT'],
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Schema/DB2SchemaManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function listTableNames()
45 45
     {
46 46
         $sql = $this->_platform->getListTablesSQL();
47
-        $sql .= " AND CREATOR = UPPER('".$this->_conn->getUsername()."')";
47
+        $sql .= " AND CREATOR = UPPER('" . $this->_conn->getUsername() . "')";
48 48
 
49 49
         $tables = $this->_conn->fetchAll($sql);
50 50
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         foreach ($tableForeignKeys as $tableForeignKey) {
172 172
             $tableForeignKey = array_change_key_case($tableForeignKey, \CASE_LOWER);
173 173
 
174
-            if (!isset($foreignKeys[$tableForeignKey['index_name']])) {
174
+            if ( ! isset($foreignKeys[$tableForeignKey['index_name']])) {
175 175
                 $foreignKeys[$tableForeignKey['index_name']] = [
176 176
                     'local_columns'   => [$tableForeignKey['local_column']],
177 177
                     'foreign_table'   => $tableForeignKey['foreign_table'],
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
         $view = array_change_key_case($view, \CASE_LOWER);
214 214
         // sadly this still segfaults on PDO_IBM, see http://pecl.php.net/bugs/bug.php?id=17199
215 215
         //$view['text'] = (is_resource($view['text']) ? stream_get_contents($view['text']) : $view['text']);
216
-        if (!is_resource($view['text'])) {
216
+        if ( ! is_resource($view['text'])) {
217 217
             $pos = strpos($view['text'], ' AS ');
218
-            $sql = substr($view['text'], $pos+4);
218
+            $sql = substr($view['text'], $pos + 4);
219 219
         } else {
220 220
             $sql = '';
221 221
         }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      * @license New BSD License
184 184
      * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html
185 185
      */
186
-    protected function _getPortableTableIndexesList($tableIndexes, $tableName=null)
186
+    protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
187 187
     {
188 188
         $indexBuffer = [];
189 189
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                 $idx = [];
218 218
                 $idx['key_name'] = $keyName;
219 219
                 $idx['primary'] = false;
220
-                $idx['non_unique'] = $tableIndex['unique']?false:true;
220
+                $idx['non_unique'] = $tableIndex['unique'] ?false:true;
221 221
 
222 222
                 $stmt = $this->_conn->executeQuery("PRAGMA INDEX_INFO ('{$keyName}')");
223 223
                 $indexArray = $stmt->fetchAll(FetchMode::ASSOCIATIVE);
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
     public function __construct(array $localColumnNames, $foreignTableName, array $foreignColumnNames, $name = null, array $options = [])
87 87
     {
88 88
         $this->_setName($name);
89
-        $identifierConstructorCallback = function ($column) {
89
+        $identifierConstructorCallback = function($column) {
90 90
             return new Identifier($column);
91 91
         };
92 92
         $this->_localColumnNames = $localColumnNames
Please login to merge, or discard this patch.