Test Failed
Push — develop ( b8f9b2...03421b )
by Neill
21:51 queued 13s
created
neon/phoebe/services/adapters/common/models/PhoebeClass.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
 		parent::afterFind();
104 104
 	}
105 105
 
106
-	public function toArray(array $fields=[], array $expand=[], $recursive=true)
106
+	public function toArray(array $fields = [], array $expand = [], $recursive = true)
107 107
 	{
108 108
 		$data = parent::toArray($fields, $expand, $recursive);
109 109
 		unset($data['serialised_definition']);
Please login to merge, or discard this patch.
Braces   +15 added lines, -11 removed lines patch added patch discarded remove patch
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 	public function beforeSave($insert)
85 85
 	{
86 86
 		// definition can only be an array and are stored as JSON or already JSON
87
-		if (is_array($this->definition) && count($this->definition))
88
-			$this->serialised_definition = json_encode($this->definition);
89
-		else {
87
+		if (is_array($this->definition) && count($this->definition)) {
88
+					$this->serialised_definition = json_encode($this->definition);
89
+		} else {
90 90
 			$this->serialised_definition = null;
91 91
 		}
92 92
 		return parent::beforeSave($insert);
@@ -98,8 +98,9 @@  discard block
 block discarded – undo
98 98
 	public function afterFind()
99 99
 	{
100 100
 		// return definition as decoded json or null
101
-		if (is_string($this->serialised_definition))
102
-			$this->definition = json_decode($this->serialised_definition, true);
101
+		if (is_string($this->serialised_definition)) {
102
+					$this->definition = json_decode($this->serialised_definition, true);
103
+		}
103 104
 		parent::afterFind();
104 105
 	}
105 106
 
@@ -120,14 +121,17 @@  discard block
 block discarded – undo
120 121
 	public static function listClassTypes($query, $filters)
121 122
 	{
122 123
 		$query = PhoebeClass::find()->select(['class_type', 'label']);
123
-		if (!empty($query))
124
-			$query->where(['like', 'label', $query]);
125
-		if (count($filters))
126
-			$query->where($filters);
124
+		if (!empty($query)) {
125
+					$query->where(['like', 'label', $query]);
126
+		}
127
+		if (count($filters)) {
128
+					$query->where($filters);
129
+		}
127 130
 		$classes = $query->orderBy('label')->asArray()->all();
128 131
 		$results = [];
129
-		foreach ($classes as $class)
130
-			$results[$class['class_type']] = $class['label'];
132
+		foreach ($classes as $class) {
133
+					$results[$class['class_type']] = $class['label'];
134
+		}
131 135
 		return $results;
132 136
 	}
133 137
 }
Please login to merge, or discard this patch.
neon/phoebe/services/adapters/common/PhoebeClassBase.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			]
61 61
 		];
62 62
 		foreach ($additionalColumns as $column) {
63
-			switch($column) {
63
+			switch ($column) {
64 64
 				case 'data':
65 65
 					$definition['serialised_data'] = [
66 66
 						'class' => 'neon\core\grid\column\DefinitionColumn',
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		// if we are locking objects to versions then an increase in version needs to
97 97
 		// result in a new row in the phoebeClass relation regardless of changes
98 98
 		$hasChanges = false;
99
-		$newModel=false;
99
+		$newModel = false;
100 100
 		try {
101 101
 			if ($model->version_locked && isset($changes['version']) && $changes['version'] != $model->version) {
102 102
 				$newModel = true;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 				$model->attributes = array_merge($oldAttrs, $changes);
105 105
 				$model->updated = date('Y-m-d H:i:s');
106 106
 				if (!$model->save())
107
-					throw new \RuntimeException('Save failed with the following errors '.print_r($model->errors,true));
107
+					throw new \RuntimeException('Save failed with the following errors '.print_r($model->errors, true));
108 108
 				$this->setModel($model);
109 109
 				$hasChanges = true;
110 110
 			} else {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 				if ($hasChanges) {
119 119
 					$model->updated = date('Y-m-d H:i:s');
120 120
 					if (!$model->save()) {
121
-						throw new \RuntimeException('Save failed with the following errors: '.print_r($model->errors,true));
121
+						throw new \RuntimeException('Save failed with the following errors: '.print_r($model->errors, true));
122 122
 					}
123 123
 				}
124 124
 			}
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	{
140 140
 		$model = $this->getModel();
141 141
 		$oldAttrs = $model->attributes;
142
-		if (($result=$this->modelDelete()) === true) {
142
+		if (($result = $this->modelDelete()) === true) {
143 143
 			$newAttrs = $model->attributes;
144 144
 			$this->createEditClassMigration($newAttrs, $oldAttrs, false);
145 145
 		}
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	{
154 154
 		$model = $this->getModel();
155 155
 		$oldAttrs = $model->attributes;
156
-		if (($result=$this->modelUndelete()) === true) {
156
+		if (($result = $this->modelUndelete()) === true) {
157 157
 			$newAttrs = $model->attributes;
158 158
 			$this->createEditClassMigration($newAttrs, $oldAttrs, false);
159 159
 		}
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 * Set any overrides onto the class
200 200
 	 * @var array
201 201
 	 */
202
-	protected $_overrides=null;
202
+	protected $_overrides = null;
203 203
 
204 204
 	/**
205 205
 	 * @inheritdoc
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	/**
259 259
 	 * @inheritdoc
260 260
 	 */
261
-	public function findOverride($filters=[])
261
+	public function findOverride($filters = [])
262 262
 	{
263 263
 		return $this->findClassOverride($filters);
264 264
 	}
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 	/**
287 287
 	 * @inheritdoc
288 288
 	 */
289
-	public function addOverride($label, $selector='', $activeFrom=null, $activeTo=null, $isActive=true)
289
+	public function addOverride($label, $selector = '', $activeFrom = null, $activeTo = null, $isActive = true)
290 290
 	{
291 291
 		$uuid = Hash::uuid64();
292 292
 		$model = $this->getModel();
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 		);
321 321
 
322 322
 		// nothing to see here move along
323
-		if (count($changes)===0)
323
+		if (count($changes) === 0)
324 324
 			return true;
325 325
 		// ok now do the edit
326 326
 		$override = $this->getClassOverrideModel($uuid);
Please login to merge, or discard this patch.
Braces   +38 added lines, -26 removed lines patch added patch discarded remove patch
@@ -103,8 +103,9 @@  discard block
 block discarded – undo
103 103
 				$model = new ClassModel();
104 104
 				$model->attributes = array_merge($oldAttrs, $changes);
105 105
 				$model->updated = date('Y-m-d H:i:s');
106
-				if (!$model->save())
107
-					throw new \RuntimeException('Save failed with the following errors '.print_r($model->errors,true));
106
+				if (!$model->save()) {
107
+									throw new \RuntimeException('Save failed with the following errors '.print_r($model->errors,true));
108
+				}
108 109
 				$this->setModel($model);
109 110
 				$hasChanges = true;
110 111
 			} else {
@@ -127,8 +128,9 @@  discard block
 block discarded – undo
127 128
 			$model->attributes = $oldAttrs;
128 129
 			return $errors;
129 130
 		}
130
-		if ($hasChanges)
131
-			$this->createEditClassMigration($model->attributes, $oldAttrs, $newModel);
131
+		if ($hasChanges) {
132
+					$this->createEditClassMigration($model->attributes, $oldAttrs, $newModel);
133
+		}
132 134
 		return $hasChanges;
133 135
 	}
134 136
 
@@ -216,10 +218,11 @@  discard block
 block discarded – undo
216 218
 	{
217 219
 		if ($overrideUuid) {
218 220
 			$override = $this->getOverride($overrideUuid);
219
-			if (isset($override['overrides']))
220
-				$this->applyClassOverrideByDefinition($override['overrides']);
221
-			else
222
-				$this->applyClassOverrideByDefinition([]);
221
+			if (isset($override['overrides'])) {
222
+							$this->applyClassOverrideByDefinition($override['overrides']);
223
+			} else {
224
+							$this->applyClassOverrideByDefinition([]);
225
+			}
223 226
 		}
224 227
 	}
225 228
 
@@ -250,8 +253,9 @@  discard block
 block discarded – undo
250 253
 				'deleted' => 0
251 254
 			])->asArray()->all();
252 255
 		$list = [];
253
-		foreach ($overrides as $o)
254
-			$list[$o['uuid']] = $o['label'];
256
+		foreach ($overrides as $o) {
257
+					$list[$o['uuid']] = $o['label'];
258
+		}
255 259
 		return $list;
256 260
 	}
257 261
 
@@ -303,8 +307,9 @@  discard block
 block discarded – undo
303 307
 		$override->created = date('Y-m-d H:i:s');
304 308
 		$override->deleted = 0;
305 309
 		$override->overrides = [];
306
-		if ($override->save())
307
-			return $uuid;
310
+		if ($override->save()) {
311
+					return $uuid;
312
+		}
308 313
 		return $override->errors;
309 314
 	}
310 315
 
@@ -320,18 +325,21 @@  discard block
 block discarded – undo
320 325
 		);
321 326
 
322 327
 		// nothing to see here move along
323
-		if (count($changes)===0)
324
-			return true;
328
+		if (count($changes)===0) {
329
+					return true;
330
+		}
325 331
 		// ok now do the edit
326 332
 		$override = $this->getClassOverrideModel($uuid);
327 333
 		if ($override) {
328 334
 			foreach ($changes as $key=>$value) {
329
-				if ($key == 'active_from')
330
-					$value = $this->setDateToNowOnEmpty($value);
335
+				if ($key == 'active_from') {
336
+									$value = $this->setDateToNowOnEmpty($value);
337
+				}
331 338
 				$override->$key = $value;
332 339
 			}
333
-			if ($override->save())
334
-				return true;
340
+			if ($override->save()) {
341
+							return true;
342
+			}
335 343
 			return $override->errors;
336 344
 		}
337 345
 		return false;
@@ -367,8 +375,9 @@  discard block
 block discarded – undo
367 375
 	public function destroyOverride($uuid)
368 376
 	{
369 377
 		$override = $this->getClassOverrideModel($uuid);
370
-		if ($override)
371
-			$override->delete();
378
+		if ($override) {
379
+					$override->delete();
380
+		}
372 381
 	}
373 382
 
374 383
 
@@ -383,8 +392,9 @@  discard block
 block discarded – undo
383 392
 	public function getDefinition()
384 393
 	{
385 394
 		$definition = $this->getModel()->definition;
386
-		if ($this->_overrides)
387
-			$definition = array_replace_recursive($definition, $this->_overrides);
395
+		if ($this->_overrides) {
396
+					$definition = array_replace_recursive($definition, $this->_overrides);
397
+		}
388 398
 		return $definition;
389 399
 	}
390 400
 
@@ -399,8 +409,9 @@  discard block
 block discarded – undo
399 409
 		$classType = $this->getClassType();
400 410
 
401 411
 		// don't do this unless we know definitely what we are
402
-		if (!$phoebeType || !$classType)
403
-			return;
412
+		if (!$phoebeType || !$classType) {
413
+					return;
414
+		}
404 415
 
405 416
 		// clear out any override objects
406 417
 		OverridesModel::deleteAll([
@@ -430,8 +441,9 @@  discard block
 block discarded – undo
430 441
 	protected function createEditClassMigration($newAttrs, $oldAttrs, $newModel)
431 442
 	{
432 443
 		// check to make sure the changes are real and need to be saved as a migration
433
-		if (!($newModel || $this->hasChanges($newAttrs, $oldAttrs)))
434
-			return;
444
+		if (!($newModel || $this->hasChanges($newAttrs, $oldAttrs))) {
445
+					return;
446
+		}
435 447
 
436 448
 		$up = $this->getTableRowReplaceSql('phoebe_class', $newAttrs);
437 449
 		$down = '';
Please login to merge, or discard this patch.
neon/phoebe/services/adapters/common/PhoebeTypeBase.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 	/**
31 31
 	 * @inheritdoc
32 32
 	 */
33
-	public function listClasses(&$paginator=[], $filters=[], $orderBy=[], $includeDeleted=false)
33
+	public function listClasses(&$paginator = [], $filters = [], $orderBy = [], $includeDeleted = false)
34 34
 	{
35 35
 		// check the inputs
36 36
 		$paginator = $this->createPaginator($paginator);
37
-		$orderBy = count($orderBy)>0 ? $orderBy : 'label ASC';
38
-		$filters = array_intersect_key($filters, array_flip(['class_type','label','description','module']));
37
+		$orderBy = count($orderBy) > 0 ? $orderBy : 'label ASC';
38
+		$filters = array_intersect_key($filters, array_flip(['class_type', 'label', 'description', 'module']));
39 39
 		if (isset($filters['class_type']))
40 40
 			$filters['class_type'] = $this->canonicaliseRef($filters['class_type']);
41 41
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		$query->select($select);
64 64
 		foreach ($filters as $key=>$value)
65 65
 			$query->andWhere(['like', "p1.$key", $value]);
66
-		if ($paginator['start']==0)
66
+		if ($paginator['start'] == 0)
67 67
 			$paginator['total'] = $query->count();
68 68
 
69 69
 		// and get the results
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	/**
83 83
 	 * @inheritdoc
84 84
 	 */
85
-	public function addClass(&$classType, $module='')
85
+	public function addClass(&$classType, $module = '')
86 86
 	{
87 87
 		$classType = $this->canonicaliseRef($classType);
88 88
 		if (empty($classType))
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	/**
107 107
 	 * @inheritdoc
108 108
 	 */
109
-	public function getClass($classType, $version=null, $classOverrideCriteria=[])
109
+	public function getClass($classType, $version = null, $classOverrideCriteria = [])
110 110
 	{
111 111
 		$classType = $this->canonicaliseRef($classType);
112 112
 		if (empty($classType))
@@ -161,20 +161,20 @@  discard block
 block discarded – undo
161 161
 	/**
162 162
 	 * @inheritdoc
163 163
 	 */
164
-	public function listObjects($classType, &$paginator=[], $filters=[], $orderBy=[], $additionalFields=[])
164
+	public function listObjects($classType, &$paginator = [], $filters = [], $orderBy = [], $additionalFields = [])
165 165
 	{
166 166
 
167 167
 		// check the inputs
168 168
 		$classType = $this->canonicaliseRef($classType);
169 169
 		$paginator = $this->createPaginator($paginator);
170
-		$orderBy = count($orderBy)>0 ? $orderBy : 'created DESC';
171
-		$filters = array_intersect_key($filters, array_flip(['version','created','updated']));
170
+		$orderBy = count($orderBy) > 0 ? $orderBy : 'created DESC';
171
+		$filters = array_intersect_key($filters, array_flip(['version', 'created', 'updated']));
172 172
 
173 173
 		$query = ObjectModel::find()->where([
174 174
 			'phoebe_type' => $this->getPhoebeType(),
175 175
 			'class_type' => $classType
176 176
 		]);
177
-		$select = ['uuid','phoebe_type','class_type','version','created','updated'];
177
+		$select = ['uuid', 'phoebe_type', 'class_type', 'version', 'created', 'updated'];
178 178
 
179 179
 		if (in_array('data', $additionalFields))
180 180
 			$select[] = 'serialised_data';
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
 		foreach ($filters as $key=>$value)
189 189
 			$query->andWhere(['=', $key, $value]);
190
-		if ($paginator['start']==0)
190
+		if ($paginator['start'] == 0)
191 191
 			$paginator['total'] = $query->count();
192 192
 		// and get the results
193 193
 		return $query->offset($paginator['start'])
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	/**
201 201
 	 * @inheritdoc
202 202
 	 */
203
-	public function addObject($classType, $classOverrideCriteria=[])
203
+	public function addObject($classType, $classOverrideCriteria = [])
204 204
 	{
205 205
 		$class = $this->getClassFromType($classType);
206 206
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 *   created automatically or if false then it is left as null.
308 308
 	 * @return neon\phoebe\services\adapters\common\models\PhoebeObject
309 309
 	 */
310
-	protected function createPhoebeObjectModel($classType, $uuid=null)
310
+	protected function createPhoebeObjectModel($classType, $uuid = null)
311 311
 	{
312 312
 		// create a model for the class
313 313
 		$model = new ObjectModel();
Please login to merge, or discard this patch.
Braces   +48 added lines, -32 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@  discard block
 block discarded – undo
36 36
 		$paginator = $this->createPaginator($paginator);
37 37
 		$orderBy = count($orderBy)>0 ? $orderBy : 'label ASC';
38 38
 		$filters = array_intersect_key($filters, array_flip(['class_type','label','description','module']));
39
-		if (isset($filters['class_type']))
40
-			$filters['class_type'] = $this->canonicaliseRef($filters['class_type']);
39
+		if (isset($filters['class_type'])) {
40
+					$filters['class_type'] = $this->canonicaliseRef($filters['class_type']);
41
+		}
41 42
 
42 43
 		/*
43 44
 		 * This slightly unusual query according to MySQL is an efficient way to find the highest version of
@@ -61,10 +62,12 @@  discard block
 block discarded – undo
61 62
 			$query->andWhere(['p1.deleted'=>0]);
62 63
 		}
63 64
 		$query->select($select);
64
-		foreach ($filters as $key=>$value)
65
-			$query->andWhere(['like', "p1.$key", $value]);
66
-		if ($paginator['start']==0)
67
-			$paginator['total'] = $query->count();
65
+		foreach ($filters as $key=>$value) {
66
+					$query->andWhere(['like', "p1.$key", $value]);
67
+		}
68
+		if ($paginator['start']==0) {
69
+					$paginator['total'] = $query->count();
70
+		}
68 71
 
69 72
 		// and get the results
70 73
 		$results = $query->offset($paginator['start'])
@@ -74,8 +77,9 @@  discard block
 block discarded – undo
74 77
 
75 78
 		// finally index them by the class_type as this is useful for changes in other classes
76 79
 		$return = [];
77
-		foreach ($results as $r)
78
-			$return[$r['class_type']] = $r;
80
+		foreach ($results as $r) {
81
+					$return[$r['class_type']] = $r;
82
+		}
79 83
 		return $return;
80 84
 	}
81 85
 
@@ -85,8 +89,9 @@  discard block
 block discarded – undo
85 89
 	public function addClass(&$classType, $module='')
86 90
 	{
87 91
 		$classType = $this->canonicaliseRef($classType);
88
-		if (empty($classType))
89
-			throw new \RuntimeException("Invalid classType $classType");
92
+		if (empty($classType)) {
93
+					throw new \RuntimeException("Invalid classType $classType");
94
+		}
90 95
 
91 96
 		// create a model for the class
92 97
 		$model = $this->createPhoebeClassModel($classType, $module);
@@ -94,8 +99,9 @@  discard block
 block discarded – undo
94 99
 		try {
95 100
 			if ($model->save()) {
96 101
 				$class = $this->createIPhoebeClass($model);
97
-			} else
98
-				throw new \Exception('Errors on save');
102
+			} else {
103
+							throw new \Exception('Errors on save');
104
+			}
99 105
 		} catch (\Exception $e) {
100 106
 			throw new \RuntimeException('Failed to create model. Exception was "'.$e->getMessage().'". Model errors were '.print_r($model->errors, true));
101 107
 		}
@@ -109,16 +115,18 @@  discard block
 block discarded – undo
109 115
 	public function getClass($classType, $version=null, $classOverrideCriteria=[])
110 116
 	{
111 117
 		$classType = $this->canonicaliseRef($classType);
112
-		if (empty($classType))
113
-			return null;
118
+		if (empty($classType)) {
119
+					return null;
120
+		}
114 121
 
115 122
 		$model = $this->getClassModel($classType, $version);
116 123
 		if ($model) {
117 124
 			$class = $this->createIPhoebeClass($model);
118 125
 			if ($classOverrideCriteria !== false) {
119 126
 				$override = $class->findClassOverride($classOverrideCriteria);
120
-				if ($override)
121
-					$class->applyClassOverrideByDefinition($override['overrides']);
127
+				if ($override) {
128
+									$class->applyClassOverrideByDefinition($override['overrides']);
129
+				}
122 130
 			}
123 131
 			return $class;
124 132
 		}
@@ -132,8 +140,9 @@  discard block
 block discarded – undo
132 140
 	{
133 141
 		$models = $this->getClassModels($classTypes);
134 142
 		$classes = array();
135
-		foreach ($models as $type => $model)
136
-			$classes[$type] = $model ? $this->createIPhoebeClass($model) : null;
143
+		foreach ($models as $type => $model) {
144
+					$classes[$type] = $model ? $this->createIPhoebeClass($model) : null;
145
+		}
137 146
 		return $classes;
138 147
 	}
139 148
 
@@ -176,8 +185,9 @@  discard block
 block discarded – undo
176 185
 		]);
177 186
 		$select = ['uuid','phoebe_type','class_type','version','created','updated'];
178 187
 
179
-		if (in_array('data', $additionalFields))
180
-			$select[] = 'serialised_data';
188
+		if (in_array('data', $additionalFields)) {
189
+					$select[] = 'serialised_data';
190
+		}
181 191
 		if (in_array('deleted', $additionalFields)) {
182 192
 			$select[] = 'deleted';
183 193
 		} else {
@@ -185,10 +195,12 @@  discard block
 block discarded – undo
185 195
 		}
186 196
 		$query->select($select);
187 197
 
188
-		foreach ($filters as $key=>$value)
189
-			$query->andWhere(['=', $key, $value]);
190
-		if ($paginator['start']==0)
191
-			$paginator['total'] = $query->count();
198
+		foreach ($filters as $key=>$value) {
199
+					$query->andWhere(['=', $key, $value]);
200
+		}
201
+		if ($paginator['start']==0) {
202
+					$paginator['total'] = $query->count();
203
+		}
192 204
 		// and get the results
193 205
 		return $query->offset($paginator['start'])
194 206
 			->limit($paginator['length'])
@@ -215,13 +227,15 @@  discard block
 block discarded – undo
215 227
 				// work out what class override needs to be applied
216 228
 				if ($classOverrideCriteria !== false) {
217 229
 					$override = $phoebeObject->findClassOverride($classOverrideCriteria, ['uuid']);
218
-					if ($override)
219
-						$model->override_uuid = $override['uuid'];
230
+					if ($override) {
231
+											$model->override_uuid = $override['uuid'];
232
+					}
220 233
 					$model->save();
221 234
 				}
222 235
 				return $phoebeObject;
223
-			} else
224
-				throw new \Exception('Errors on save');
236
+			} else {
237
+							throw new \Exception('Errors on save');
238
+			}
225 239
 		} catch (\Exception $e) {
226 240
 			throw new \RuntimeException('Failed to create model. Exception was "'.$e->getMessage().'". Model errors were '.print_r($model->errors, true));
227 241
 		}
@@ -252,13 +266,15 @@  discard block
 block discarded – undo
252 266
 	protected function getClassFromType($classType)
253 267
 	{
254 268
 		$classType = $this->canonicaliseRef($classType);
255
-		if (empty($classType))
256
-			throw new \RuntimeException("Invalid classType '$classType'");
269
+		if (empty($classType)) {
270
+					throw new \RuntimeException("Invalid classType '$classType'");
271
+		}
257 272
 
258 273
 		// check a class of this classType exists
259 274
 		$class = $this->getClassModel($classType);
260
-		if (!$class)
261
-			throw new \RuntimeException("No class of type '$classType' available");
275
+		if (!$class) {
276
+					throw new \RuntimeException("No class of type '$classType' available");
277
+		}
262 278
 		return $class;
263 279
 	}
264 280
 
Please login to merge, or discard this patch.
neon/phoebe/services/adapters/common/PhoebeBase.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	public function toArray()
67 67
 	{
68
-		$model =  $this->getModel();
68
+		$model = $this->getModel();
69 69
 		return $model ? $model->toArray() : [];
70 70
 	}
71 71
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 	 *   'start', 'length', and 'total'
144 144
 	 * @return array
145 145
 	 */
146
-	protected function createPaginator($paginator=[])
146
+	protected function createPaginator($paginator = [])
147 147
 	{
148 148
 		return [
149
-			'start'=> (isset($paginator['start']) ? max(0, (int)$paginator['start']) : 0),
150
-			'length'=> (isset($paginator['length']) ? max(1,min(self::CLASS_LIST_LIMIT,(int)$paginator['length'])) : self::CLASS_LIST_LIMIT),
151
-			'total'=> (isset($paginator['total']) ? (int)$paginator['total'] : null)
149
+			'start'=> (isset($paginator['start']) ? max(0, (int) $paginator['start']) : 0),
150
+			'length'=> (isset($paginator['length']) ? max(1, min(self::CLASS_LIST_LIMIT, (int) $paginator['length'])) : self::CLASS_LIST_LIMIT),
151
+			'total'=> (isset($paginator['total']) ? (int) $paginator['total'] : null)
152 152
 		];
153 153
 	}
154 154
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 * @param string $version
223 223
 	 * @return \neon\phoebe\services\adapters\common\models\PhoebeClass
224 224
 	 */
225
-	protected function getClassModel($classType, $version=null)
225
+	protected function getClassModel($classType, $version = null)
226 226
 	{
227 227
 		$query = ClassModel::find()->where([
228 228
 			'phoebe_type'=>$this->getPhoebeType(),
@@ -296,11 +296,11 @@  discard block
 block discarded – undo
296 296
 		$fields = [];
297 297
 		$values = [];
298 298
 		foreach ($row as $f=>$v) {
299
-			$fields[]=$f;
299
+			$fields[] = $f;
300 300
 			$values[] = $this->pdoQuote($v);
301 301
 		}
302 302
 		if (count($fields))
303
-			return "REPLACE INTO `$table` (`".(implode('`,`',$fields)).'`) VALUES ('.(implode(",",$values)).");";
303
+			return "REPLACE INTO `$table` (`".(implode('`,`', $fields)).'`) VALUES ('.(implode(",", $values)).");";
304 304
 		return null;
305 305
 	}
306 306
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	 * @param array $fields  use these to select a subset of fields returned.
330 330
 	 * @return array  the override
331 331
 	 */
332
-	protected function findClassOverride($filters, $fields=[])
332
+	protected function findClassOverride($filters, $fields = [])
333 333
 	{
334 334
 		$selectFields = [
335 335
 			'uuid', 'label', 'selector', 'is_active', 'active_from', 'active_to', 'serialised_overrides'
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		// convert a request for overrides to serialised_overrides
338 338
 		if ($fields) {
339 339
 			if (in_array('overrides', $fields))
340
-				$fields[] ='serialised_overrides';
340
+				$fields[] = 'serialised_overrides';
341 341
 			$selectFields = array_intersect($selectFields, $fields);
342 342
 		}
343 343
 		$selector = !empty($filters['selector']) ? $filters['selector'] : '';
Please login to merge, or discard this patch.
Braces   +52 added lines, -36 removed lines patch added patch discarded remove patch
@@ -83,8 +83,9 @@  discard block
 block discarded – undo
83 83
 	public function __get($name)
84 84
 	{
85 85
 		$attrs = $this->getModelAttributes();
86
-		if (array_key_exists($name, $attrs))
87
-			return $attrs[$name];
86
+		if (array_key_exists($name, $attrs)) {
87
+					return $attrs[$name];
88
+		}
88 89
 		return parent::__get($name);
89 90
 	}
90 91
 
@@ -92,10 +93,11 @@  discard block
 block discarded – undo
92 93
 	{
93 94
 		$model = $this->getModel();
94 95
 		$attrs = $model->attributes();
95
-		if (in_array($name, $attrs))
96
-			$model->$name = $value;
97
-		else
98
-			parent::__set($name, $value);
96
+		if (in_array($name, $attrs)) {
97
+					$model->$name = $value;
98
+		} else {
99
+					parent::__set($name, $value);
100
+		}
99 101
 	}
100 102
 
101 103
 	/**
@@ -106,8 +108,9 @@  discard block
 block discarded – undo
106 108
 	 */
107 109
 	protected function getPhoebeType()
108 110
 	{
109
-		if (empty($this->phoebeType))
110
-			throw new \RuntimeException('The phoebeType needs to be set during construction');
111
+		if (empty($this->phoebeType)) {
112
+					throw new \RuntimeException('The phoebeType needs to be set during construction');
113
+		}
111 114
 		return $this->phoebeType;
112 115
 	}
113 116
 
@@ -119,8 +122,9 @@  discard block
 block discarded – undo
119 122
 	 */
120 123
 	protected function getClassType()
121 124
 	{
122
-		if (empty($this->classType))
123
-			throw new \RuntimeException('The classType needs to be set during construction');
125
+		if (empty($this->classType)) {
126
+					throw new \RuntimeException('The classType needs to be set during construction');
127
+		}
124 128
 		return $this->classType;
125 129
 	}
126 130
 
@@ -132,8 +136,9 @@  discard block
 block discarded – undo
132 136
 	 */
133 137
 	protected function getClassVersion()
134 138
 	{
135
-		if (empty($this->classVersion))
136
-			throw new \RuntimeException('The classVersion needs to be set during construction');
139
+		if (empty($this->classVersion)) {
140
+					throw new \RuntimeException('The classVersion needs to be set during construction');
141
+		}
137 142
 		return $this->classVersion;
138 143
 	}
139 144
 
@@ -172,8 +177,9 @@  discard block
 block discarded – undo
172 177
 	 */
173 178
 	protected function getModel()
174 179
 	{
175
-		if (!$this->_model)
176
-			throw new \RuntimeException('The model has not yet been set');
180
+		if (!$this->_model) {
181
+					throw new \RuntimeException('The model has not yet been set');
182
+		}
177 183
 		return $this->_model;
178 184
 	}
179 185
 
@@ -183,8 +189,9 @@  discard block
 block discarded – undo
183 189
 	 */
184 190
 	protected function getModelAttributes()
185 191
 	{
186
-		if ($this->_model)
187
-			return $this->_model->attributes;
192
+		if ($this->_model) {
193
+					return $this->_model->attributes;
194
+		}
188 195
 		return [];
189 196
 	}
190 197
 
@@ -197,8 +204,9 @@  discard block
 block discarded – undo
197 204
 	{
198 205
 		$model = $this->getModel();
199 206
 		$model->deleted = 1;
200
-		if ($model->save())
201
-			return true;
207
+		if ($model->save()) {
208
+					return true;
209
+		}
202 210
 		return $model->errors;
203 211
 	}
204 212
 
@@ -211,8 +219,9 @@  discard block
 block discarded – undo
211 219
 	{
212 220
 		$model = $this->getModel();
213 221
 		$model->deleted = 0;
214
-		if ($model->save())
215
-			return true;
222
+		if ($model->save()) {
223
+					return true;
224
+		}
216 225
 		return $model->errors;
217 226
 	}
218 227
 
@@ -228,10 +237,11 @@  discard block
 block discarded – undo
228 237
 			'phoebe_type'=>$this->getPhoebeType(),
229 238
 			'class_type'=>$classType
230 239
 		]);
231
-		if ($version)
232
-			$query->andWhere(['version'=>$version]);
233
-		else
234
-			$query->limit(1)->orderBy('version DESC');
240
+		if ($version) {
241
+					$query->andWhere(['version'=>$version]);
242
+		} else {
243
+					$query->limit(1)->orderBy('version DESC');
244
+		}
235 245
 
236 246
 		return $query->one();
237 247
 	}
@@ -268,8 +278,9 @@  discard block
 block discarded – undo
268 278
 			->andWhere('b.version IS NULL')
269 279
 			->all();
270 280
 		$classes = [];
271
-		foreach ($models as $model)
272
-			$classes[$model->class_type] = $model;
281
+		foreach ($models as $model) {
282
+					$classes[$model->class_type] = $model;
283
+		}
273 284
 		return $classes;
274 285
 	}
275 286
 
@@ -291,16 +302,18 @@  discard block
 block discarded – undo
291 302
 	 */
292 303
 	protected function getTableRowReplaceSql($table, $row)
293 304
 	{
294
-		if (!is_array($row))
295
-			$row = $row->toArray();
305
+		if (!is_array($row)) {
306
+					$row = $row->toArray();
307
+		}
296 308
 		$fields = [];
297 309
 		$values = [];
298 310
 		foreach ($row as $f=>$v) {
299 311
 			$fields[]=$f;
300 312
 			$values[] = $this->pdoQuote($v);
301 313
 		}
302
-		if (count($fields))
303
-			return "REPLACE INTO `$table` (`".(implode('`,`',$fields)).'`) VALUES ('.(implode(",",$values)).");";
314
+		if (count($fields)) {
315
+					return "REPLACE INTO `$table` (`".(implode('`,`',$fields)).'`) VALUES ('.(implode(",",$values)).");";
316
+		}
304 317
 		return null;
305 318
 	}
306 319
 
@@ -336,8 +349,9 @@  discard block
 block discarded – undo
336 349
 		];
337 350
 		// convert a request for overrides to serialised_overrides
338 351
 		if ($fields) {
339
-			if (in_array('overrides', $fields))
340
-				$fields[] ='serialised_overrides';
352
+			if (in_array('overrides', $fields)) {
353
+							$fields[] ='serialised_overrides';
354
+			}
341 355
 			$selectFields = array_intersect($selectFields, $fields);
342 356
 		}
343 357
 		$selector = !empty($filters['selector']) ? $filters['selector'] : '';
@@ -366,10 +380,12 @@  discard block
 block discarded – undo
366 380
 	 */
367 381
 	private function pdoQuote($value)
368 382
 	{
369
-		if (is_array($value))
370
-			$value = json_encode($value);
371
-		if (is_null($value))
372
-			return 'null';
383
+		if (is_array($value)) {
384
+					$value = json_encode($value);
385
+		}
386
+		if (is_null($value)) {
387
+					return 'null';
388
+		}
373 389
 		return neon()->db->pdo->quote($value);
374 390
 	}
375 391
 
Please login to merge, or discard this patch.
neon/phoebe/services/adapters/daedalus/PhoebeObject.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@  discard block
 block discarded – undo
36 36
 	public function setDataSources($sources)
37 37
 	{
38 38
 		foreach ($sources as $key=>$value) {
39
-			if (empty($value))
40
-				unset($sources[$key]);
39
+			if (empty($value)) {
40
+							unset($sources[$key]);
41
+			}
41 42
 		}
42 43
 		$this->dataSources = $sources;
43 44
 	}
@@ -114,8 +115,9 @@  discard block
 block discarded – undo
114 115
 	 */
115 116
 	protected function ddo()
116 117
 	{
117
-		if ($this->_ddo == null)
118
-			$this->_ddo = neon('dds')->IDdsObjectManagement;
118
+		if ($this->_ddo == null) {
119
+					$this->_ddo = neon('dds')->IDdsObjectManagement;
120
+		}
119 121
 		return $this->_ddo;
120 122
 	}
121 123
 
Please login to merge, or discard this patch.
neon/phoebe/services/adapters/daedalus/PhoebeClass.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	public function editClass($changes)
56 56
 	{
57 57
 		if (!is_array($changes))
58
-			throw new \RuntimeException('You should pass an array into editClass. You passed in '.print_r($changes,true));
58
+			throw new \RuntimeException('You should pass an array into editClass. You passed in '.print_r($changes, true));
59 59
 
60 60
 		// make the appropriate changes to dds. Any unknown fields are ignored
61 61
 		$this->dds()->editClass($this->classType, $changes);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 		foreach ($fields as $k => $f) {
74 74
 			// map some form to Phoebe differences
75
-			$f['link_class'] = (!empty($f['linkClass']) ? $f['linkClass'] : null);  // named differently
75
+			$f['link_class'] = (!empty($f['linkClass']) ? $f['linkClass'] : null); // named differently
76 76
 			// extract the definition for saving in phoebe
77 77
 			$definition = $f['definition'];
78 78
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
 		// and save to phoebe - remove unallowed phoebe values for Daedalus tables
123 123
 		$changes = array_diff_key($changes, array_flip(['version', 'volatile', 'object_history', 'version_locked']));
124
-		if (count($changes)==0)
124
+		if (count($changes) == 0)
125 125
 			return;
126 126
 		$hasChanges = parent::editClass($changes);
127 127
 		return $hasChanges;
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	/** --------------------------------------- **/
162 162
 	/** -------- Class Override Methods ------- **/
163 163
 
164
-	public function addOverride($label, $selector='', $activeFrom=null, $activeTo=null, $isActive=true)
164
+	public function addOverride($label, $selector = '', $activeFrom = null, $activeTo = null, $isActive = true)
165 165
 	{
166 166
 		throw new \RuntimeException("Overrides are not available for Daedalus tables");
167 167
 	}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 *   reordering the form in the process
194 194
 	 * @return array
195 195
 	 */
196
-	protected function getDefinitionAsForm($excludeDeletedFields=true, array $restrictToFields=[])
196
+	protected function getDefinitionAsForm($excludeDeletedFields = true, array $restrictToFields = [])
197 197
 	{
198 198
 		$fields = [];
199 199
 		$definition = $this->definition;
Please login to merge, or discard this patch.
Braces   +29 added lines, -20 removed lines patch added patch discarded remove patch
@@ -54,8 +54,9 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	public function editClass($changes)
56 56
 	{
57
-		if (!is_array($changes))
58
-			throw new \RuntimeException('You should pass an array into editClass. You passed in '.print_r($changes,true));
57
+		if (!is_array($changes)) {
58
+					throw new \RuntimeException('You should pass an array into editClass. You passed in '.print_r($changes,true));
59
+		}
59 60
 
60 61
 		// make the appropriate changes to dds. Any unknown fields are ignored
61 62
 		$this->dds()->editClass($this->classType, $changes);
@@ -108,10 +109,11 @@  discard block
 block discarded – undo
108 109
 			if ($f['mapField'] == 1 && $currentData['map_field'] == 0) {
109 110
 				$this->dds()->setMemberAsMapField($this->classType, $memberRef);
110 111
 			}
111
-			if ($definition['deleted'] == 1 && $currentData['deleted'] == 0)
112
-				$this->dds()->deleteMember($this->classType, $memberRef);
113
-			else if ($definition['deleted'] == 0 && $currentData['deleted'] == 1)
114
-				$this->dds()->undeleteMember($this->classType, $memberRef);
112
+			if ($definition['deleted'] == 1 && $currentData['deleted'] == 0) {
113
+							$this->dds()->deleteMember($this->classType, $memberRef);
114
+			} else if ($definition['deleted'] == 0 && $currentData['deleted'] == 1) {
115
+							$this->dds()->undeleteMember($this->classType, $memberRef);
116
+			}
115 117
 			if ($definition['deleted'] == -1) {
116 118
 				// remove definition from phoebe
117 119
 				unset($changes['definition']['fields'][$k]);
@@ -121,8 +123,9 @@  discard block
 block discarded – undo
121 123
 
122 124
 		// and save to phoebe - remove unallowed phoebe values for Daedalus tables
123 125
 		$changes = array_diff_key($changes, array_flip(['version', 'volatile', 'object_history', 'version_locked']));
124
-		if (count($changes)==0)
125
-			return;
126
+		if (count($changes)==0) {
127
+					return;
128
+		}
126 129
 		$hasChanges = parent::editClass($changes);
127 130
 		return $hasChanges;
128 131
 	}
@@ -132,8 +135,9 @@  discard block
 block discarded – undo
132 135
 	 */
133 136
 	public function deleteClass()
134 137
 	{
135
-		if (($result = parent::deleteClass()))
136
-			$this->dds()->deleteClass($this->classType);
138
+		if (($result = parent::deleteClass())) {
139
+					$this->dds()->deleteClass($this->classType);
140
+		}
137 141
 		return $result;
138 142
 	}
139 143
 
@@ -142,8 +146,9 @@  discard block
 block discarded – undo
142 146
 	 */
143 147
 	public function undeleteClass()
144 148
 	{
145
-		if (($result = parent::undeleteClass()))
146
-			$this->dds()->undeleteClass($this->classType);
149
+		if (($result = parent::undeleteClass())) {
150
+					$this->dds()->undeleteClass($this->classType);
151
+		}
147 152
 		return $result;
148 153
 	}
149 154
 
@@ -152,8 +157,9 @@  discard block
 block discarded – undo
152 157
 	 */
153 158
 	public function destroyClass()
154 159
 	{
155
-		if (($result = parent::destroyClass()))
156
-			$this->dds()->destroyClass($this->classType);
160
+		if (($result = parent::destroyClass())) {
161
+					$this->dds()->destroyClass($this->classType);
162
+		}
157 163
 		return $result;
158 164
 	}
159 165
 
@@ -199,8 +205,9 @@  discard block
 block discarded – undo
199 205
 		$definition = $this->definition;
200 206
 		$order = 0;
201 207
 		$restrictFields = count($restrictToFields) > 0;
202
-		if ($restrictFields)
203
-			$restrictFieldPostion = array_flip($restrictToFields);
208
+		if ($restrictFields) {
209
+					$restrictFieldPostion = array_flip($restrictToFields);
210
+		}
204 211
 		if (isset($definition['fields'])) {
205 212
 			$fields = $definition['fields'];
206 213
 			foreach ($fields as $key=>$field) {
@@ -215,8 +222,9 @@  discard block
 block discarded – undo
215 222
 				if (isset($field['definition'])) {
216 223
 					$fields[$key] = $field['definition'];
217 224
 					$fields[$key]['mapField'] = $field['mapField'];
218
-					if (isset($field['deleted']))
219
-						$fields[$key]['deleted'] = $field['deleted'];
225
+					if (isset($field['deleted'])) {
226
+											$fields[$key]['deleted'] = $field['deleted'];
227
+					}
220 228
 					// TODO - 20180522 NJ
221 229
 					// THIS WILL GO WRONG WITH DELETED FIELDS WHERE FINAL SUBMIT BUTTON MAY BE IN WRONG PLACE
222 230
 					$fields[$key]['order'] = ($restrictFields ? ($restrictFieldPostion[$key]) : $order++);
@@ -232,8 +240,9 @@  discard block
 block discarded – undo
232 240
 	protected $_dds = null;
233 241
 	protected function dds()
234 242
 	{
235
-		if ($this->_dds == null)
236
-			$this->_dds = neon('dds')->iDdsClassManagement;
243
+		if ($this->_dds == null) {
244
+					$this->_dds = neon('dds')->iDdsClassManagement;
245
+		}
237 246
 		return $this->_dds;
238 247
 	}
239 248
 
Please login to merge, or discard this patch.
neon/phoebe/services/adapters/daedalus/PhoebeType.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 * Set this up as a daedalus type
48 48
 	 * @param array $config
49 49
 	 */
50
-	public function __construct($config=[])
50
+	public function __construct($config = [])
51 51
 	{
52 52
 		$path = '\neon\phoebe\services\adapters\daedalus';
53 53
 		$config['phoebeType'] = 'daedalus';
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
 	/** ------------ Class Methods ----------- **/
96 96
 
97
-	public function listClasses(&$paginator=[], $filters=[], $orderBy=[], $includeDeleted=false)
97
+	public function listClasses(&$paginator = [], $filters = [], $orderBy = [], $includeDeleted = false)
98 98
 	{
99 99
 		$classes = parent::listClasses($paginator, $filters, $orderBy, $includeDeleted);
100 100
 		$this->mergeDaedalusFields($classes);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	/**
105 105
 	 * @inheritdoc
106 106
 	 */
107
-	public function addClass(&$classType, $module='')
107
+	public function addClass(&$classType, $module = '')
108 108
 	{
109 109
 		$classType = $this->canonicaliseRef($classType);
110 110
 		$class = parent::addClass($classType, $module);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	/**
128 128
 	 * @inheritdoc
129 129
 	 */
130
-	public function listObjects($classType, &$paginator=[], $filters=[], $orderBy=[], $additionalFields=[])
130
+	public function listObjects($classType, &$paginator = [], $filters = [], $orderBy = [], $additionalFields = [])
131 131
 	{
132 132
 		$filters = null;
133 133
 		// get our data directly from daedalus - objects are not stored in phoebe
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	/**
150 150
 	 * @inheritdoc
151 151
 	 */
152
-	public function addObject($classType, $overrideCriteria=[])
152
+	public function addObject($classType, $overrideCriteria = [])
153 153
 	{
154 154
 		// Daedalus doesn't manage overrides currently
155 155
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 				$classes[$ct]['count_current'] = 0;
210 210
 				$classTypes[] = $ct;
211 211
 			}
212
-			$query = "SELECT * FROM dds_class WHERE `class_type` IN ('".implode("','",$classTypes)."')";
212
+			$query = "SELECT * FROM dds_class WHERE `class_type` IN ('".implode("','", $classTypes)."')";
213 213
 			$counts = neon()->db->createCommand($query)->queryAll();
214 214
 			foreach ($counts as $c) {
215 215
 				$classes[$c['class_type']] = array_merge($classes[$c['class_type']], $c);
Please login to merge, or discard this patch.
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -65,8 +65,9 @@  discard block
 block discarded – undo
65 65
 		$class = $this->canonicaliseRef($class);
66 66
 
67 67
 		// descriptions of a class are stored as hints in the form
68
-		if (isset($definition['description']))
69
-			$definition['hint'] = $definition['description'];
68
+		if (isset($definition['description'])) {
69
+					$definition['hint'] = $definition['description'];
70
+		}
70 71
 
71 72
 		// pass the definition to a form object and then get back the full definition
72 73
 		$definition['name'] = $class;
@@ -78,8 +79,9 @@  discard block
 block discarded – undo
78 79
 
79 80
 		// save the class information
80 81
 		$phoebeClass = $this->getClass($class);
81
-		if (!$phoebeClass)
82
-			$phoebeClass = $this->addClass($class, $module);
82
+		if (!$phoebeClass) {
83
+					$phoebeClass = $this->addClass($class, $module);
84
+		}
83 85
 		$phoebeClass->editClass($classDefinition);
84 86
 
85 87
 		// close the migration
@@ -159,8 +161,9 @@  discard block
 block discarded – undo
159 161
 		$ddsObject = $this->ddo()->getObject($objectId);
160 162
 
161 163
 		$object = $objectId ? $this->createFauxIPhoebeObject($classType, $objectId, $ddsObject) : null;
162
-		if ($object)
163
-			$object->changeLogUuid = $changeLogUuid;
164
+		if ($object) {
165
+					$object->changeLogUuid = $changeLogUuid;
166
+		}
164 167
 		return $object;
165 168
 	}
166 169
 
@@ -221,16 +224,18 @@  discard block
 block discarded – undo
221 224
 	protected $_dds = null;
222 225
 	protected function dds()
223 226
 	{
224
-		if ($this->_dds == null)
225
-			$this->_dds = neon('dds')->IDdsClassManagement;
227
+		if ($this->_dds == null) {
228
+					$this->_dds = neon('dds')->IDdsClassManagement;
229
+		}
226 230
 		return $this->_dds;
227 231
 	}
228 232
 
229 233
 	protected $_ddo = null;
230 234
 	protected function ddo()
231 235
 	{
232
-		if ($this->_ddo == null)
233
-			$this->_ddo = neon('dds')->IDdsObjectManagement;
236
+		if ($this->_ddo == null) {
237
+					$this->_ddo = neon('dds')->IDdsObjectManagement;
238
+		}
234 239
 		return $this->_ddo;
235 240
 	}
236 241
 
Please login to merge, or discard this patch.
neon/phoebe/services/adapters/basic/PhoebeClass.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 	/**
19 19
 	 * @inheritdoc
20 20
 	 */
21
-	public function getClassFormDefinition(array $fields=[])
21
+	public function getClassFormDefinition(array $fields = [])
22 22
 	{
23 23
 		return [];
24 24
 	}
Please login to merge, or discard this patch.
neon/phoebe/services/adapters/basic/PhoebeType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
  */
15 15
 class PhoebeType extends PhoebeTypeBase
16 16
 {
17
-	public function __construct($config=[])
17
+	public function __construct($config = [])
18 18
 	{
19 19
 		$path = '\neon\phoebe\services\adapters\basic';
20 20
 		$config['phoebeType'] = 'basic';
Please login to merge, or discard this patch.