Skip to content

Commit

Permalink
Improved HproseService
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Apr 21, 2018
1 parent f77aab7 commit 8d8371c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Hprose/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* *
* hprose service class for php 5.3+ *
* *
* LastModified: Feb 26, 2018 *
* LastModified: Apr 21, 2018 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
Expand Down Expand Up @@ -327,7 +327,7 @@ private function beforeInvoke($name, array &$args, stdClass $context) {
}
$passContext = $context->passContext;
if ($passContext === null) {
$passContext = $this->passContext;
$context->passContext = $passContext = $this->passContext;
}
if ($context->async) {
$self = $this;
Expand Down Expand Up @@ -370,11 +370,11 @@ private function beforeInvoke($name, array &$args, stdClass $context) {
But PHP 5.3 can't call private method in closure,
so we comment the private keyword.
*/
/*private*/ function afterInvoke($name, array $args, stdClass $context, $result) {
if ($context->async && is_callable($args[count($args) - 1])) {
/*private*/ function afterInvoke($name, array &$args, stdClass $context, $result) {
if ($context->async && (count($args) > 0) && is_callable($args[count($args) - 1])) {
unset($args[count($args) - 1]);
}
if ($context->passContext && ($args[count($args) - 1] === $context)) {
if ($context->passContext && (count($args) > 0) && ($args[count($args) - 1] === $context)) {
unset($args[count($args) - 1]);
}
if ($this->onAfterInvoke !== null) {
Expand Down

0 comments on commit 8d8371c

Please sign in to comment.