From 413b74b0089bd46a12b36ff061ce3c65b37f02b6 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 11 Oct 2023 09:45:14 +0200 Subject: [PATCH] Fix types --- src/Rules/BannedNodesRule.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Rules/BannedNodesRule.php b/src/Rules/BannedNodesRule.php index a9db004..07fae1a 100644 --- a/src/Rules/BannedNodesRule.php +++ b/src/Rules/BannedNodesRule.php @@ -26,7 +26,7 @@ class BannedNodesRule implements Rule { /** - * @var array + * @var array */ private $bannedNodes; @@ -36,7 +36,7 @@ class BannedNodesRule implements Rule private $bannedFunctions; /** - * @param array> $bannedNodes + * @param array}> $bannedNodes */ public function __construct(array $bannedNodes) { @@ -85,20 +85,16 @@ public function processNode(Node $node, Scope $scope): array * * php-parser makes the same normalization. * - * @param array> $bannedNodes + * @param array $bannedNodes * @return array */ protected function normalizeFunctionNames(array $bannedNodes): array { - if(! isset($bannedNodes['Expr_FuncCall']['functions'])) { - return []; - } - return array_map( static function (string $function): string { return ltrim($function, '\\'); }, - $bannedNodes['Expr_FuncCall']['functions'] + $bannedNodes['Expr_FuncCall']['functions'] ?? [] ); } }