Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit c711fbd

Browse files
committed
Fixes failing tests on PHP 7.4
From PHP 7.4 docs: Calling get_object_vars() on an ArrayObject instance will now always return the properties of the ArrayObject itself (or a subclass). Previously it returned the values of the wrapped array/object unless the STD_PROP_LIST flag was specified. Other affected operations are: * ReflectionObject::getProperties() * reset(), current(), etc. Use Iterator methods instead. * Potentially others working on object properties as a list.
1 parent cd691f9 commit c711fbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
$vars = $this->vars();
3+
$vars = (array) $this->vars();
44

55
if (empty($vars)) {
66
echo "No object model passed";
77
} elseif (isset($vars['message'])) {
88
echo $vars['message'];
99
} else {
10-
$objKey = current($this->vars())->helper->getObjectKey();
10+
$objKey = current($vars)->helper->getObjectKey();
1111
echo 'This is an iteration with objectKey: ' . $objKey;
1212
}

0 commit comments

Comments
 (0)