Passed
Push — master ( 9c8316...cdf196 )
by Andreas
12:35 queued 09:42
created
src/storage/connection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@
 block discarded – undo
213 213
             $midgard = midgard_connection::get_instance();
214 214
             if ($midgard->config->logfilename) {
215 215
                 $logdir = dirname($midgard->config->logfilename);
216
-                if (   !is_dir($logdir)
216
+                if (!is_dir($logdir)
217 217
                     && !mkdir($logdir, 0777, true)) {
218 218
                     throw exception::user_data('Log directory could not be created');
219 219
                 }
Please login to merge, or discard this patch.
src/command/schema.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         $mgd_config = midgard_connection::get_instance()->config;
57 57
         $mgdschema_file = $mgd_config->vardir . '/mgdschema_classes.php';
58
-        if (   file_exists($mgdschema_file)
58
+        if (file_exists($mgdschema_file)
59 59
             && !unlink($mgdschema_file)) {
60 60
             throw new \RuntimeException('Could not unlink ' . $mgdschema_file);
61 61
         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $cms = $em->getMetadataFactory()->getAllMetadata();
73 73
 
74 74
         // create storage
75
-        if (    !midgard_storage::create_base_storage()
75
+        if (!midgard_storage::create_base_storage()
76 76
              && midgard_connection::get_instance()->get_error_string() != 'MGD_ERR_OK') {
77 77
             throw new \Exception("Failed to create base database structures" . midgard_connection::get_instance()->get_error_string());
78 78
         }
Please login to merge, or discard this patch.
src/mgdschema/type.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
         } else {
66 66
             if ($property->parentfield) {
67 67
                 $this->parentfield = $property->name;
68
-                if (   empty($this->parent)
68
+                if (empty($this->parent)
69 69
                     && $property->link) {
70 70
                     $this->parent = $property->link['target'];
71 71
                 }
Please login to merge, or discard this patch.
src/mgdschema/manager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
 
76 76
         $fqcn = $this->get_fcqn($property->link['target']);
77 77
 
78
-        if (   isset($this->types[$fqcn])
78
+        if (isset($this->types[$fqcn])
79 79
             || $property->link['target'] === $property->get_parent()->name) {
80 80
             return $property->link['target'];
81 81
         }
Please login to merge, or discard this patch.
api/midgard/collector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
         $parsed = $this->parse_constraint_name($property);
74 74
 
75 75
         // for properties like up.name
76
-        if (   strpos($property, ".") !== false
76
+        if (strpos($property, ".") !== false
77 77
             && !(strpos($property, "metadata") === 0)) {
78 78
             return $parsed['name'] . " as " . str_replace(".", "_", $property);
79 79
         }
Please login to merge, or discard this patch.
src/api/config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
         $subdirs = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'];
124 124
         foreach ($subdirs as $dir) {
125 125
             foreach ($subdirs as $subdir) {
126
-                if (   !is_dir($this->blobdir . '/' . $dir . '/' . $subdir)
126
+                if (!is_dir($this->blobdir . '/' . $dir . '/' . $subdir)
127 127
                     && !mkdir($this->blobdir . '/' . $dir . '/' . $subdir, 0777, true)) {
128 128
                     return false;
129 129
                 }
Please login to merge, or discard this patch.
src/driver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@
 block discarded – undo
152 152
 
153 153
         foreach ($properties as $name => $property) {
154 154
             // doctrine can handle id links only
155
-            if (   $property->link
155
+            if ($property->link
156 156
                 && $target_class = $this->manager->resolve_targetclass($property)) {
157 157
                 $link_mapping = [
158 158
                     'fieldName' => $property->name,
Please login to merge, or discard this patch.
src/api/dbobject.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $this->initialize();
61 61
         $properties = array_merge($this->cm->getFieldNames(), $this->cm->getAssociationNames(), array_keys($this->cm->midgard['field_aliases']));
62
-        $properties = array_filter($properties, function ($input) {
62
+        $properties = array_filter($properties, function($input) {
63 63
             return strpos($input, 'metadata_') === false;
64 64
         });
65 65
         $ret = [];
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     {
75 75
         $this->initialize();
76 76
 
77
-        if (   !$this->cm->hasField($field)
77
+        if (!$this->cm->hasField($field)
78 78
             && isset($this->cm->midgard['field_aliases'][$field])) {
79 79
             $field = $this->cm->midgard['field_aliases'][$field];
80 80
         }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             if (empty($value)) {
85 85
                 $value = null;
86 86
             } else {
87
-                if (   !\is_object($this->$field)
87
+                if (!\is_object($this->$field)
88 88
                     || $this->$field->id != $value) {
89 89
                     $this->changed_associations[$field] = true;
90 90
                 }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         } elseif ($this->cm->hasField($field)) {
95 95
             $mapping = $this->cm->getFieldMapping($field);
96 96
 
97
-            if (   $mapping['type'] === 'string'
97
+            if ($mapping['type'] === 'string'
98 98
                 || $mapping['type'] == 'text') {
99 99
                 $value = (string) $value;
100 100
             } elseif ($mapping['type'] === 'integer') {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             } elseif ($mapping['type'] === 'float') {
105 105
                 $value = (float) $value;
106 106
             } elseif ($mapping['type'] === 'datetime') {
107
-                if (   \is_string($value)
107
+                if (\is_string($value)
108 108
                     && $value !== '0000-00-00 00:00:00') {
109 109
                     $value = new midgard_datetime($value);
110 110
                 } elseif (!($value instanceof midgard_datetime)) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $this->initialize();
122 122
 
123
-        if (   !$this->cm->hasField($field)
123
+        if (!$this->cm->hasField($field)
124 124
             && isset($this->cm->midgard['field_aliases'][$field])) {
125 125
             $field = $this->cm->midgard['field_aliases'][$field];
126 126
         }
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
             }
134 134
             return 0;
135 135
         }
136
-        if (   $this->$field === null
136
+        if ($this->$field === null
137 137
             && $this->cm->isIdentifier($field)) {
138 138
             return 0;
139 139
         }
140
-        if (   $this->$field instanceof midgard_datetime
140
+        if ($this->$field instanceof midgard_datetime
141 141
             && $this->$field->format('U') == -62169984000) {
142 142
             //This is mainly needed for working with converted Legacy databases. Midgard2 somehow handles this internally
143 143
             //@todo Find a nicer solution and research how QB handles this
Please login to merge, or discard this patch.
src/api/user.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
     private function load_by_properties(array $properties)
66 66
     {
67
-        if (   !array_key_exists('authtype', $properties)
67
+        if (!array_key_exists('authtype', $properties)
68 68
             || !array_key_exists('login', $properties)) {
69 69
             throw exception::invalid_property_value();
70 70
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
     public function &get_person() : person
109 109
     {
110
-        if (   $this->person_object === null
110
+        if ($this->person_object === null
111 111
             && $this->person !== null) {
112 112
             $this->person_object = connection::get_em()->getRepository(connection::get_fqcn('midgard_person'))->findOneBy(['guid' => $this->person]);
113 113
         }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
     public function create() : bool
118 118
     {
119
-        if (   empty($this->authtype)
119
+        if (empty($this->authtype)
120 120
             || !empty($this->id)) {
121 121
             exception::invalid_property_value();
122 122
             return false;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     protected function is_unique() : bool
182 182
     {
183
-        if (   empty($this->login)
183
+        if (empty($this->login)
184 184
             || empty($this->authtype)) {
185 185
             return true;
186 186
         }
Please login to merge, or discard this patch.