Test Failed
Branch master (622e79)
by Andreas
02:55
created
src/mgdschema/translator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         if (!isset(self::$typemap[$typeattribute])) {
39 39
             throw new \Exception('unknown type ' . $typeattribute);
40 40
         }
41
-        $search = ['unsigned ', 'guid',   'datetime', 'longtext', 'text'];
41
+        $search = ['unsigned ', 'guid', 'datetime', 'longtext', 'text'];
42 42
         $replace = ['', 'string', 'midgard_datetime', 'string', 'string'];
43 43
 
44 44
         return str_replace($search, $replace, $typeattribute);
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.
src/storage/subscriber.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
             $cs = $em->getUnitOfWork()->getEntityChangeSet($entity);
96 96
             // We only need to update repligard if we're coming from create (revision 0)
97 97
             // or if we delete/undelete
98
-            if (   !array_key_exists('metadata_deleted', $cs)
99
-                && $entity->metadata_revision > 0)  {
98
+            if (!array_key_exists('metadata_deleted', $cs)
99
+                && $entity->metadata_revision > 0) {
100 100
                 $check_repligard = false;
101 101
             }
102 102
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
         foreach ($columns as $name => &$config) {
159 159
             if ($platform->getName() === 'sqlite') {
160
-                if (   !empty($config['primary'])
160
+                if (!empty($config['primary'])
161 161
                     && !empty($config['autoincrement'])) {
162 162
                     /*
163 163
                      * This is essentially a workaround for http://www.doctrine-project.org/jira/browse/DBAL-642
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                     $modified = true;
167 167
                     $config['columnDefinition'] = 'INTEGER PRIMARY KEY AUTOINCREMENT';
168 168
                 }
169
-                if (   !empty($config['comment'])
169
+                if (!empty($config['comment'])
170 170
                     && $config['comment'] == 'BINARY') {
171 171
                     $modified = true;
172 172
                     $config['columnDefinition'] = $config['type']->getSQLDeclaration($config, $platform) . ' COLLATE BINARY' . $platform->getDefaultValueDeclarationSQL($config);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                         $config['columnDefinition'] = $config['comment'] . $platform->getDefaultValueDeclarationSQL($config);
184 184
                     }
185 185
                     if (!empty($config['columnDefinition']) && $platform->supportsInlineColumnComments()) {
186
-                        $config['columnDefinition'] .=  " COMMENT " . $platform->quoteStringLiteral($config['comment']);
186
+                        $config['columnDefinition'] .= " COMMENT " . $platform->quoteStringLiteral($config['comment']);
187 187
                     }
188 188
                 }
189 189
             }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $args)
277 277
     {
278 278
         $table = $args->getClassTable();
279
-        if (   !$table->hasOption('engine')
279
+        if (!$table->hasOption('engine')
280 280
             || $table->getOption('engine') !== 'MyISAM') {
281 281
             return;
282 282
         }
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/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 = [];
@@ -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
             && isset($this->cm->midgard['field_aliases'][$field])) {
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
             && isset($this->cm->midgard['field_aliases'][$field])) {
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.