Skip to content

Commit d67ed2a

Browse files
Fix Unit test warning about undefined property
PhpUnit Test: ``` - 1 test triggered 2 PHP warnings: 1) /home/runner/work/ipl-stdlib/ipl-stdlib/src/Filter.php:540 Undefined property: stdClass::$foo Triggered by: * ipl\Tests\Stdlib\FilterTest::testConditionsHandleMissingColumnsProperly (6 times) /home/runner/work/ipl-stdlib/ipl-stdlib/tests/FilterTest.php:624 ... ```
1 parent c473720 commit d67ed2a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Filter.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,7 @@ protected function performMatch(Rule $rule, $row)
536536
*/
537537
protected function extractValue($column, $row)
538538
{
539-
try {
540-
return $row->{$column};
541-
} catch (Throwable $_) {
542-
return null;
543-
}
539+
return $row->$column ?? null;
544540
}
545541

546542
/**

0 commit comments

Comments
 (0)