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 6b72809..d69c6a7 100644 --- a/src/YieldingMiddlewareFactory.php +++ b/src/YieldingMiddlewareFactory.php @@ -58,7 +58,7 @@ private static function iterateStmts(array $stmts, string $dir, string $file): a $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; }