Skip to content
This repository was archived by the owner on May 12, 2022. It is now read-only.

Commit d6a5969

Browse files
author
Nik Barham
committed
More linting
1 parent 736ce65 commit d6a5969

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/Orm/Collection.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,53 +413,56 @@ public function filter($filter, $invertAffix = false)
413413
foreach ($valueList as $value) {
414414
// Compare based on affix (else == )
415415
switch ($affix) {
416-
417-
case '=': case '==': default:
416+
case '=':
417+
case '==':
418+
default:
418419
if ($item->$property == $value) {
419420
// Found match - move on to next filter
420421
continue 3; // Back to foreach $filter
421422
}
422-
break;
423+
break;
423424

424-
case '!=': case '!': case '<>':
425+
case '!=':
426+
case '!':
427+
case '<>':
425428
if ($item->$property == $value) {
426429
// Found a negative match, remove this item and move on to next property
427430
unset($copy[$itemKey]);
428431
continue 4; // Back to foreach $copy
429432
}
430-
break;
433+
break;
431434

432435
case '>':
433436
if ($item->$property <= $value) {
434437
// Found a negative match, remove this item and move on to next property
435438
unset($copy[$itemKey]);
436439
continue 4; // Back to foreach $copy
437440
}
438-
break;
441+
break;
439442

440443
case '>=':
441444
if ($item->$property < $value) {
442445
// Found a negative match, remove this item and move on to next property
443446
unset($copy[$itemKey]);
444447
continue 4; // Back to foreach $copy
445448
}
446-
break;
449+
break;
447450

448451
case '<':
449452
if ($item->$property >= $value) {
450453
// Found a negative match, remove this item and move on to next property
451454
unset($copy[$itemKey]);
452455
continue 4; // Back to foreach $copy
453456
}
454-
break;
457+
break;
455458

456459
case '<=':
457460
if ($item->$property > $value) {
458461
// Found a negative match, remove this item and move on to next property
459462
unset($copy[$itemKey]);
460463
continue 4; // Back to foreach $copy
461464
}
462-
break;
465+
break;
463466
}
464467
}
465468

src/Orm/Model.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ final public static function factory($where, $classOrTablename = null, $schema =
118118
foreach ($data as $row) {
119119
if (!$obj = Model::$instance[$namespace][$table][$row['id']]) {
120120
// Database data object unique to this object
121-
$data_obj = Data::make($row, $table, $schema);
121+
$dataObj = Data::make($row, $table, $schema);
122122

123123
// Create the object!!
124-
$obj = new $class($data_obj);
124+
$obj = new $class($dataObj);
125125

126126
// Store it in the object cache.
127127
Model::$instance[$namespace][$table][$row['id']] = $obj;
@@ -229,13 +229,13 @@ public static function newData(Model $parentObject = null)
229229
// Make a new blank data object
230230
$data = new Data([], $table, $schema, false, true);
231231

232-
$table_schema = $schema->getTable($table);
232+
$tableSchema = $schema->getTable($table);
233233
// "Foreign" tables use a "parent" table for their primary key. We need that parent object for it's id.
234-
if ($table_schema['type'] == 'foreign') {
234+
if ($tableSchema['type'] == 'foreign') {
235235
if (!$parentObject) {
236236
throw new Exception\Model('NO_PARENT_OBJECT', [$namespace, $class, $table, static::$tablename]);
237237
}
238-
$model_data->id = $parentObject->id;
238+
$data->id = $parentObject->id;
239239
}
240240

241241
return $data;

0 commit comments

Comments
 (0)