Completed
Branch dev_2x (79898e)
by Adrian
09:26
created
src/ConnectionLocator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     public static function new(...$args)
11 11
     {
12 12
         if ($args[0] instanceof Connection) {
13
-            return new ConnectionLocator(function () use ($args) {
13
+            return new ConnectionLocator(function() use ($args) {
14 14
                 return $args[0];
15 15
             });
16 16
         }
Please login to merge, or discard this patch.
src/QueryBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
     public static function getInstance()
18 18
     {
19
-        if ( ! static::$instance) {
19
+        if (!static::$instance) {
20 20
             static::$instance = new static;
21 21
         }
22 22
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     protected function getQueryClass(Mapper $mapper)
34 34
     {
35 35
         $mapperClass = get_class($mapper);
36
-        if ( ! isset($this->queryClasses[$mapperClass])) {
36
+        if (!isset($this->queryClasses[$mapperClass])) {
37 37
             $queryClass = $mapperClass . 'Query';
38 38
             if (class_exists($queryClass)) {
39 39
                 $this->queryClasses[$mapperClass] = $queryClass;
Please login to merge, or discard this patch.
src/MapperConfig.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function getTableAlias($fallbackToTable = false)
151 151
     {
152
-        return ( ! $this->tableAlias && $fallbackToTable) ? $this->table : $this->tableAlias;
152
+        return (!$this->tableAlias && $fallbackToTable) ? $this->table : $this->tableAlias;
153 153
     }
154 154
 
155 155
     /**
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
     public function getTableReference()
221 221
     {
222
-        if ( ! $this->tableReference) {
222
+        if (!$this->tableReference) {
223 223
             $this->tableReference = QueryHelper::reference($this->table, $this->tableAlias);
224 224
         }
225 225
 
Please login to merge, or discard this patch.
src/Mapper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $mapper               = new static($connectionLocator);
60 60
         $mapper->mapperConfig = $mapperConfig;
61 61
 
62
-        if ( ! empty($mapperConfig->getBehaviours())) {
62
+        if (!empty($mapperConfig->getBehaviours())) {
63 63
             $mapper->use(...$mapperConfig->getBehaviours());
64 64
         }
65 65
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
     public function getRelation($name): Relation
188 188
     {
189
-        if ( ! $this->hasRelation($name)) {
189
+        if (!$this->hasRelation($name)) {
190 190
             throw new \InvalidArgumentException("Relation named {$name} is not registered for this mapper");
191 191
         }
192 192
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             $this->relations[$name] = $this->orm->createRelation($this, $name, $this->relations[$name]);
195 195
         }
196 196
         $relation = $this->relations[$name];
197
-        if ( ! $relation instanceof Relation) {
197
+        if (!$relation instanceof Relation) {
198 198
             throw new \InvalidArgumentException("Relation named {$name} is not a proper Relation instance");
199 199
         }
200 200
 
Please login to merge, or discard this patch.
src/Helpers/Str.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
     public static function underscore(string $str): string
17 17
     {
18
-        if ( ! isset(static::$cache['underscore'][$str])) {
18
+        if (!isset(static::$cache['underscore'][$str])) {
19 19
             $str = preg_replace("/([A-Z]+)/", ' $1', $str);
20 20
             $str = strtolower($str);
21 21
             $str = preg_replace("/[^a-z0-9]+/", ' ', $str);
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     public static function methodName(string $str, string $verb): string
30 30
     {
31 31
         $key = $verb . $str;
32
-        if ( ! isset(static::$cache['methodName'][$key])) {
32
+        if (!isset(static::$cache['methodName'][$key])) {
33 33
             static::$cache['methodName'][$key] = strtolower($verb) . static::className($str);
34 34
         }
35 35
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
     public static function variableName(string $str): string
40 40
     {
41
-        if ( ! isset(static::$cache['variableName'][$str])) {
41
+        if (!isset(static::$cache['variableName'][$str])) {
42 42
             $class = static::className($str);
43 43
 
44 44
             static::$cache['variableName'][$str] = strtolower(substr($class, 0, 1)) . substr($class, 1);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     public static function className(string $str): string
51 51
     {
52
-        if ( ! isset(static::$cache['className'][$str])) {
52
+        if (!isset(static::$cache['className'][$str])) {
53 53
             $str = strtolower($str);
54 54
             $str = preg_replace("/[^a-z0-9]+/", ' ', $str);
55 55
             $str = ucwords($str);
Please login to merge, or discard this patch.
src/Helpers/QueryHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 {
8 8
     public static function reference($table, $tableAlias)
9 9
     {
10
-        if ( ! $tableAlias || $table == $tableAlias) {
10
+        if (!$tableAlias || $table == $tableAlias) {
11 11
             return $table;
12 12
         }
13 13
 
Please login to merge, or discard this patch.
src/Helpers/Arr.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             if (strpos($key, $separator)) {
27 27
                 $parents = static::getParents($key, $separator);
28 28
                 foreach ($parents as $parent) {
29
-                    if ( ! isset($arr[$parent])) {
29
+                    if (!isset($arr[$parent])) {
30 30
                         $arr[$parent] = null;
31 31
                     }
32 32
                 }
Please login to merge, or discard this patch.
src/Definition/Relation.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,24 +41,24 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $errors = [];
43 43
 
44
-        if ( ! $this->type) {
44
+        if (!$this->type) {
45 45
             $errors[] = "Uknown relation type";
46 46
         }
47 47
 
48
-        if ( ! $this->nativeKey) {
48
+        if (!$this->nativeKey) {
49 49
             $errors[] = "Missing native key column";
50 50
         }
51 51
 
52
-        if ( ! $this->foreignMapper) {
52
+        if (!$this->foreignMapper) {
53 53
             $errors[] = "Missing foreign mapper name";
54 54
         }
55 55
 
56
-        if ( ! $this->foreignKey) {
56
+        if (!$this->foreignKey) {
57 57
             $errors[] = "Missing foreign key";
58 58
         }
59 59
 
60 60
         $strategies = [RelationConfig::LOAD_LAZY, RelationConfig::LOAD_EAGER, RelationConfig::LOAD_NONE];
61
-        if ( ! in_array($this->loadStrategy, $strategies)) {
61
+        if (!in_array($this->loadStrategy, $strategies)) {
62 62
             $errors[] = sprintf("Relation loading strategy is not valid (allowed values: %s)", implode(', ', $strategies));
63 63
         }
64 64
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
     public function toArray() {
189 189
         $result = [];
190
-        foreach(get_object_vars($this) as $prop => $value) {
190
+        foreach (get_object_vars($this) as $prop => $value) {
191 191
             if (in_array($prop, ['mapper'])) {
192 192
                 continue;
193 193
             }
Please login to merge, or discard this patch.
src/Definition/Column.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -152,11 +152,11 @@
 block discarded – undo
152 152
     {
153 153
         $errors = [];
154 154
 
155
-        if ( ! $this->name) {
155
+        if (!$this->name) {
156 156
             $errors[] = 'Column requires a name';
157 157
         }
158 158
 
159
-        if ( ! $this->type) {
159
+        if (!$this->type) {
160 160
             $errors[] = 'Column requires a type';
161 161
         } elseif (($type = $this->getConstantByValue($this->type)) && substr($type, 0, 5) !== 'TYPE_') {
162 162
             $errors[] = sprintf('Column does not have a valid type (%s)', $this->type);
Please login to merge, or discard this patch.