From 4596c28ba70744e0ce5d6d07aff8fb610ddeb04b Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Thu, 16 Aug 2018 22:48:05 +0200 Subject: [PATCH] Support nikic/php-parser 3 and 4 --- composer.json | 2 +- src/YieldingMiddlewareFactory.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 8cecde7..5b9f626 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "php": "^7.0", "recoil/react": "^1.0", "recoil/recoil": "^1.0", - "nikic/php-parser": "^3.1", + "nikic/php-parser": "^4.0 || ^3.1", "psr/http-server-middleware": "^1.0" }, "require-dev": { diff --git a/src/YieldingMiddlewareFactory.php b/src/YieldingMiddlewareFactory.php index 9ba37d9..2c8e674 100644 --- a/src/YieldingMiddlewareFactory.php +++ b/src/YieldingMiddlewareFactory.php @@ -52,7 +52,7 @@ private static function iterateStmts(array $stmts): array $stmt->implements = []; } - if ($stmt instanceof ClassMethod && $stmt->name === 'process') { + if ($stmt instanceof ClassMethod && (string)$stmt->name === 'process') { $stmt->returnType = null; $stmt->params[1]->type = null; }