Completed
Pull Request — master (#49)
by Thomas
02:21
created
src/Dbal/Type/Number.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function validate($value)
24 24
     {
25 25
         if (!is_int($value) && !is_double($value) && (!is_string($value) || !is_numeric($value))) {
26
-            return new NoNumber([ 'value' => (string) $value ]);
26
+            return new NoNumber(['value' => (string) $value]);
27 27
         }
28 28
 
29 29
         return true;
Please login to merge, or discard this patch.
src/Dbal/Type/DateTime.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $this->precision = (int) $precision;
37 37
         $this->regex     = $dateOnly ?
38
-            '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' :
39
-            '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/';
38
+            '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' : '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/';
40 39
     }
41 40
 
42 41
     public static function factory(Dbal $dbal, array $columnDefinition)
@@ -56,7 +55,7 @@  discard block
 block discarded – undo
56 55
     public function validate($value)
57 56
     {
58 57
         if (!$value instanceof \DateTime && (!is_string($value) || !preg_match($this->regex, $value))) {
59
-            return new NoDateTime([ 'value' => (string) $value ]);
58
+            return new NoDateTime(['value' => (string) $value]);
60 59
         }
61 60
 
62 61
         return true;
Please login to merge, or discard this patch.
src/Dbal/Type/Time.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
                 return new Error([], 'DATETIME', 'DateTime is not allowed for time');
33 33
             }
34 34
 
35
-            return new NoTime([ 'value' => (string) $value ]);
35
+            return new NoTime(['value' => (string) $value]);
36 36
         }
37 37
 
38 38
         return true;
Please login to merge, or discard this patch.
src/Dbal/Column.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     protected static function getRegisteredType(array $columnDefinition)
42 42
     {
43 43
         foreach (self::$registeredTypes as $class) {
44
-            if (call_user_func([ $class, 'fits' ], $columnDefinition)) {
44
+            if (call_user_func([$class, 'fits'], $columnDefinition)) {
45 45
                 return $class;
46 46
             }
47 47
         }
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
                 $class = $this->columnDefinition['type'];
153 153
             }
154 154
 
155
-            if ($class === null || !is_callable([ $class, 'factory' ])) {
155
+            if ($class === null || !is_callable([$class, 'factory'])) {
156 156
                 $class = Type\Text::class;
157 157
             }
158 158
 
159
-            $this->type = call_user_func([ $class, 'factory' ], $this->dbal, $this->columnDefinition);
159
+            $this->type = call_user_func([$class, 'factory'], $this->dbal, $this->columnDefinition);
160 160
         }
161 161
 
162 162
         return $this->type;
Please login to merge, or discard this patch.
src/Dbal/Mysql.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,8 +92,7 @@
 block discarded – undo
92 92
 
93 93
         $definition['column_name']              = $rawColumn['Field'];
94 94
         $definition['is_nullable']              = $rawColumn['Null'] === 'YES';
95
-        $definition['column_default']           = $rawColumn['Default'] !== null ? $rawColumn['Default'] :
96
-            ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null);
95
+        $definition['column_default']           = $rawColumn['Default'] !== null ? $rawColumn['Default'] : ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null);
97 96
         $definition['character_maximum_length'] = null;
98 97
         $definition['datetime_precision']       = null;
99 98
 
Please login to merge, or discard this patch.
src/Dbal/Sqlite.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     public function describe($schemaTable)
54 54
     {
55 55
         $table = explode($this->identifierDivider, $schemaTable);
56
-        list($schema, $table) = count($table) === 2 ? $table : [ null, $table[ 0 ] ];
56
+        list($schema, $table) = count($table) === 2 ? $table : [null, $table[0]];
57 57
         $schema = $schema !== null ? $this->escapeIdentifier($schema) . '.' : '';
58 58
 
59 59
         $result     = $this->entityManager->getConnection()->query(
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         return count(array_filter(array_map(
87 87
             function ($rawColumn) {
88
-                return $rawColumn[ 'pk' ];
88
+                return $rawColumn['pk'];
89 89
             },
90 90
             $rawColumns
91 91
         ))) > 1;
Please login to merge, or discard this patch.
src/Relation/OneToMany.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,6 +56,6 @@
 block discarded – undo
56 56
             $expression[] = $alias . '.' . $myVar . ' = ' . $this->name . '.' . $hisVar;
57 57
         }
58 58
 
59
-        call_user_func([ $fetcher, $join ], $this->class, implode(' AND ', $expression), $this->name, [], true);
59
+        call_user_func([$fetcher, $join], $this->class, implode(' AND ', $expression), $this->name, [], true);
60 60
     }
61 61
 }
Please login to merge, or discard this patch.
src/Relation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@
 block discarded – undo
147 147
 //            return null;
148 148
 //        }
149 149
 
150
-        return call_user_func([ $this->class, 'getRelation' ], $this->opponent);
150
+        return call_user_func([$this->class, 'getRelation'], $this->opponent);
151 151
     }
152 152
 
153 153
     /**
Please login to merge, or discard this patch.
src/Entity/Relations.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,7 +168,6 @@
 block discarded – undo
168 168
 
169 169
         $relation = $this::getRelation($relation);
170 170
 
171
-        return $getAll ? $relation->fetchAll($this, $this->entityManager) :
172
-            $relation->fetch($this, $this->entityManager);
171
+        return $getAll ? $relation->fetchAll($this, $this->entityManager) : $relation->fetch($this, $this->entityManager);
173 172
     }
174 173
 }
Please login to merge, or discard this patch.