Completed
Push — master ( 17f8b4...ce01a0 )
by Andreas
03:13
created
api/midgard/collector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $parsed = $this->parse_constraint_name($property);
71 71
 
72 72
         // for properties like up.name
73
-        if (   strpos($property, ".") !== false
73
+        if (strpos($property, ".") !== false
74 74
             && !(strpos($property, "metadata") === 0))
75 75
         {
76 76
             return $parsed['name'] . " as " . str_replace(".", "_", $property);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function get($key)
156 156
     {
157
-        if (   !$this->_has_results()
157
+        if (!$this->_has_results()
158 158
             || !isset($this->_results[$key]))
159 159
         {
160 160
             return false;
Please login to merge, or discard this patch.
api/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 use midgard\portable\mgdschema\translator;
10 10
 use midgard\portable\api\error\exception;
11 11
 
12
-if (   extension_loaded('midgard')
12
+if (extension_loaded('midgard')
13 13
     || extension_loaded('midgard2'))
14 14
 {
15 15
     //TODO: Print some error?
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
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
             $fqcn = $this->namespace . '\\' . $fqcn;
81 81
         }
82 82
 
83
-        if (   array_key_exists($fqcn, $this->types)
83
+        if (array_key_exists($fqcn, $this->types)
84 84
             || $property->link['target'] === $property->get_parent()->name)
85 85
         {
86 86
             $target_class = $property->link['target'];
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
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
             if ($property->parentfield)
77 77
             {
78 78
                 $this->parentfield = $property->name;
79
-                if (   empty($this->parent)
79
+                if (empty($this->parent)
80 80
                     && $property->link)
81 81
                 {
82 82
                     $this->parent = $property->link['target'];
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
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
         $mgd_config = midgard_connection::get_instance()->config;
62 62
         $mgdobjects_file = $mgd_config->vardir . '/midgard_objects.php';
63
-        if (   file_exists($mgdobjects_file)
63
+        if (file_exists($mgdobjects_file)
64 64
             && !unlink($mgdobjects_file))
65 65
         {
66 66
             throw new \RuntimeException('Could not unlink ' . $mgdobjects_file);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $cms = $em->getMetadataFactory()->getAllMetadata();
81 81
 
82 82
         // create storage
83
-        if (    !midgard_storage::create_base_storage()
83
+        if (!midgard_storage::create_base_storage()
84 84
              && midgard_connection::get_instance()->get_error_string() != 'MGD_ERR_OK')
85 85
         {
86 86
             throw new \Exception("Failed to create base database structures" . midgard_connection::get_instance()->get_error_string());
Please login to merge, or discard this patch.
api/midgard/replicator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -201,19 +201,19 @@
 block discarded – undo
201 201
                 break;
202 202
         }
203 203
 
204
-        if (   $dbobject->id > 0
204
+        if ($dbobject->id > 0
205 205
             && $dbobject->metadata->revised >= $object->metadata->revised) {
206 206
             midgard_connection::get_instance()->set_error(exception::OBJECT_IMPORTED);
207 207
             return false;
208 208
         }
209 209
 
210
-        if (   $dbobject->metadata->deleted
210
+        if ($dbobject->metadata->deleted
211 211
             && !$object->metadata->deleted) {
212 212
             if (!midgard_object_class::undelete($dbobject->guid)) {
213 213
                 return false;
214 214
             }
215 215
             $dbobject->metadata_deleted = false;
216
-        } elseif (   !$dbobject->metadata->deleted
216
+        } elseif (!$dbobject->metadata->deleted
217 217
                  && $object->metadata->deleted) {
218 218
             return $dbobject->delete();
219 219
         }
Please login to merge, or discard this patch.
src/classgenerator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
         }
64 64
 
65 65
         $types = $this->manager->get_types();
66
-        uasort($types, function ($a, $b) {
67
-            if (   !empty($a->extends)
66
+        uasort($types, function($a, $b) {
67
+            if (!empty($a->extends)
68 68
                 && !empty($b->extends)) {
69 69
                 return strnatcmp($a->extends, $b->extends);
70 70
             } elseif (!empty($a->extends)) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $prefix = $this->get_class_prefix($namespace);
106 106
 
107 107
         foreach ($this->manager->get_types() as $type) {
108
-            if (   $prefix !== ''
108
+            if ($prefix !== ''
109 109
                 && !class_exists($type->name)) {
110 110
                 $this->add_line('class_alias( "' . $prefix . $type->name . '", "' . $type->name . '");');
111 111
             }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         foreach ($this->manager->get_inherited_mapping() as $child => $parent) {
115 115
             $this->add_line('class_alias( "' . $prefix . $parent . '", "' . $prefix . $child . '");');
116
-            if (   $prefix !== ''
116
+            if ($prefix !== ''
117 117
                 && !class_exists($child)) {
118 118
                 $this->add_line('class_alias( "' . $prefix . $parent . '", "' . $child . '");');
119 119
             }
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
                     $objects[$name] = 'new midgard_datetime("0001-01-01 00:00:00")';
178 178
                     break;
179 179
             }
180
-            if (   $default !== null
180
+            if ($default !== null
181 181
                    // we need to skip working links because in this case, Doctrine expects objects as values
182
-                && (   !$property->link
182
+                && (!$property->link
183 183
                     || $this->manager->resolve_targetclass($property) === false)) {
184 184
                 $line .= ' = ' . $default;
185 185
             }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     {
224 224
         $this->add_line('class ' . $type->name . ' extends ' . $type->extends);
225 225
         $mixins = $type->get_mixins();
226
-        $interfaces = array_filter(array_map(function ($name) {
226
+        $interfaces = array_filter(array_map(function($name) {
227 227
             if (interface_exists('\\midgard\\portable\\storage\\' . $name . '\\entity')) {
228 228
                 return '\\midgard\\portable\\storage\\' . $name . '\\entity';
229 229
             }
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
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     private function load_by_properties(array $properties)
63 63
     {
64
-        if (   !array_key_exists('authtype', $properties)
64
+        if (!array_key_exists('authtype', $properties)
65 65
             || !array_key_exists('login', $properties)) {
66 66
             throw exception::invalid_property_value();
67 67
         }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
     public function &get_person()
111 111
     {
112
-        if (   $this->person_object === null
112
+        if ($this->person_object === null
113 113
             && $this->person !== null) {
114 114
             $this->person_object = connection::get_em()->getRepository('midgard:midgard_person')->findOneBy(array('guid' => $this->person));
115 115
         }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
     public function create()
120 120
     {
121
-        if (   empty($this->authtype)
121
+        if (empty($this->authtype)
122 122
             || !empty($this->id)) {
123 123
             exception::invalid_property_value();
124 124
             return false;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
     protected function is_unique()
184 184
     {
185
-        if (   empty($this->login)
185
+        if (empty($this->login)
186 186
             || empty($this->authtype)) {
187 187
             return true;
188 188
         }
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
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $this->initialize();
65 65
         $properties = array_merge($this->cm->getFieldNames(), $this->cm->getAssociationNames(), array_keys($this->cm->midgard['field_aliases']));
66
-        $properties = array_filter($properties, function ($input) {
66
+        $properties = array_filter($properties, function($input) {
67 67
             return (strpos($input, 'metadata_') === false);
68 68
         });
69 69
         $ret = array();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $this->initialize();
80 80
 
81
-        if (   !$this->cm->hasField($field)
81
+        if (!$this->cm->hasField($field)
82 82
             && array_key_exists($field, $this->cm->midgard['field_aliases'])) {
83 83
             $field = $this->cm->midgard['field_aliases'][$field];
84 84
         }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             if (empty($value)) {
89 89
                 $value = null;
90 90
             } else {
91
-                if (   !is_object($this->$field)
91
+                if (!is_object($this->$field)
92 92
                     || $this->$field->id != $value) {
93 93
                     $this->changed_associations[$field] = true;
94 94
                 }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         } elseif ($this->cm->hasField($field)) {
99 99
             $mapping = $this->cm->getFieldMapping($field);
100 100
 
101
-            if (   $mapping['type'] === 'string'
101
+            if ($mapping['type'] === 'string'
102 102
                 || $mapping['type'] == 'text') {
103 103
                 $value = (string) $value;
104 104
             } elseif ($mapping['type'] === 'integer') {
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             } elseif ($mapping['type'] === 'float') {
109 109
                 $value = (float) $value;
110 110
             } elseif ($mapping['type'] === 'midgard_datetime') {
111
-                if (   is_string($value)
111
+                if (is_string($value)
112 112
                     && $value !== '0000-00-00 00:00:00') {
113 113
                     $value = new midgard_datetime($value);
114 114
                 } elseif (!($value instanceof midgard_datetime)) {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     {
125 125
         $this->initialize();
126 126
 
127
-        if (   !$this->cm->hasField($field)
127
+        if (!$this->cm->hasField($field)
128 128
             && array_key_exists($field, $this->cm->midgard['field_aliases'])) {
129 129
             $field = $this->cm->midgard['field_aliases'][$field];
130 130
         }
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
             }
138 138
             return 0;
139 139
         }
140
-        if (   $this->$field === null
140
+        if ($this->$field === null
141 141
             && $this->cm->isIdentifier($field)) {
142 142
             return 0;
143 143
         }
144
-        if (   $this->$field instanceof midgard_datetime
144
+        if ($this->$field instanceof midgard_datetime
145 145
             && $this->$field->format('U') == -62169984000) {
146 146
             //This is mainly needed for working with converted Legacy databases. Midgard2 somehow handles this internally
147 147
             //@todo Find a nicer solution and research how QB handles this
Please login to merge, or discard this patch.