Skip to content
This repository has been archived by the owner on Jul 11, 2018. It is now read-only.

Commit

Permalink
Cast ARP rules to arrays when service registry sends objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris Steyn committed Jul 3, 2017
1 parent ca612d6 commit 831bf41
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Entity/Assembler/JanusPushMetadataAssembler.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,17 @@ private function assembleAttributeReleasePolicy(stdClass $connection)
return array();
}

// EngineBlock expects objects in the metadata in many places so we
// can't decode the metadata with assoc=true. ARP rules should always
// be arrays so we explicitly cast the ARP rules to arrays here.
foreach ($connection->arp_attributes as &$rules) {
foreach ($rules as &$rule) {
if (is_object($rule)) {
$rule = (array) $rule;
}
}
}

return array(
'attributeReleasePolicy' => new AttributeReleasePolicy(
(array) $connection->arp_attributes
Expand Down

0 comments on commit 831bf41

Please sign in to comment.