Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

wrap this in an isset check, callbacks is sometimes missing (prolly due ... #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions src/DNode/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,21 +163,23 @@ private function scrub($obj)
private function unscrub($msg) {
$args = $msg->arguments;
$session = $this;
foreach ($msg->callbacks as $id => $path) {
if (!isset($this->wrapped[$id])) {
$this->wrapped[$id] = function() use ($session, $id) {
$session->request((int) $id, func_get_args());
};
}
$location =& $args;
foreach ($path as $part) {
if (is_array($location)) {
$location =& $location[$part];
continue;
if (isset($msg->callbacks)) {
foreach ($msg->callbacks as $id => $path) {
if (!isset($this->wrapped[$id])) {
$this->wrapped[$id] = function() use ($session, $id) {
$session->request((int) $id, func_get_args());
};
}
$location =& $args;
foreach ($path as $part) {
if (is_array($location)) {
$location =& $location[$part];
continue;
}
$location =& $location->$part;
}
$location =& $location->$part;
$location = $this->wrapped[$id];
}
$location = $this->wrapped[$id];
}
return $args;
}
Expand Down