Skip to content

Commit

Permalink
bugfix, 修复Generator::getReturn()方法在php5无法使用的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yeaha committed Jun 1, 2016
1 parent 298c3af commit 18cc923
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ public function execute(array $arguments = [], array $handlers = [])

$generator->next();

// PHP7之前没有Generator::getReturn()
if (version_compare(PHP_VERSION, '7.0.0', '<')) {
$return = true;
}

if (!$return) {
$return = true;
$result = $generator->getReturn();
Expand Down

0 comments on commit 18cc923

Please sign in to comment.