Skip to content

Commit

Permalink
Fix PHPStan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz committed Dec 19, 2023
1 parent 878f4d9 commit f361f9b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/TwigHooks/src/Twig/Runtime/HooksRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,18 @@ private function formatBaseString(string $base): string
foreach ($parts as $part) {
$resultPart = trim($part, '_');
$resultPart = str_replace(['@', '.html.twig'], '', $resultPart);
$resultPart = strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $resultPart));
/** @var string $resultPart */
$resultPart = preg_replace('/(?<!^)[A-Z]/', '_$0', $resultPart);
$resultPart = strtolower($resultPart);
$resultParts[] = $resultPart;
}

return implode('.', $resultParts);
}

/**
* @param array<string, mixed> $context
*
* @return array<string, string>
*/
public function getHookableData(array $context): array
Expand All @@ -67,6 +71,8 @@ public function getHookableData(array $context): array
}

/**
* @param array<string, mixed> $context
*
* @return array<string, string>
*/
public function getHookableConfiguration(array $context): array
Expand Down

0 comments on commit f361f9b

Please sign in to comment.