nodeTypeResolver = $nodeTypeResolver; } /** * @param ClassMethod|Closure|Function_|Stmt[] $functionLike */ public function hasNeverFuncCall($functionLike) : bool { $hasNeverType = \false; $stmts = $functionLike instanceof FunctionLike ? (array) $functionLike->stmts : $functionLike; foreach ($stmts as $stmt) { if ($stmt instanceof Expression) { $stmt = $stmt->expr; } if ($stmt instanceof Stmt) { continue; } $stmtType = $this->nodeTypeResolver->getNativeType($stmt); if ($stmtType instanceof NeverType) { $hasNeverType = \true; } } return $hasNeverType; } }