diff --git a/phpdotnet/phd/ObjectStorage.php b/phpdotnet/phd/ObjectStorage.php index 1d5218d3..d7c7d75c 100644 --- a/phpdotnet/phd/ObjectStorage.php +++ b/phpdotnet/phd/ObjectStorage.php @@ -3,19 +3,20 @@ class ObjectStorage extends \SplObjectStorage { - public function attach(object $object, mixed $info = array()): void { + public function attach(object $object, mixed $info = []): void { if (!($object instanceof Format)) { throw new \InvalidArgumentException( 'Only classess inheriting ' . __NAMESPACE__ . '\\Format supported' ); } if (empty($info)) { - $info = array( + $info = [ \XMLReader::ELEMENT => $object->getElementMap(), \XMLReader::TEXT => $object->getTextMap(), - ); + ]; } - parent::attach($object, $info); + + $this->offsetSet($object, $info); } }