We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0b7cc4d + 4dcd506 commit 6f9c1b0Copy full SHA for 6f9c1b0
src/StubEnvironment.php
@@ -41,15 +41,12 @@ public function getFilter($name): ?TwigFilter
41
public function getFunction($name): ?TwigFunction
42
{
43
/**
44
- * @var string[]
45
* @psalm-suppress InternalMethod
46
*/
47
- $defaultFunctions = array_keys(parent::getFunctions());
48
- $isDefault = isset($defaultFunctions[$name]);
+ $defaultFunction = parent::getFunction($name);
49
50
- if ($isDefault) { // don't attempt to stub twig's builtin function
51
- /** @psalm-suppress InternalMethod */
52
- return parent::getFunction($name) ?: null;
+ if ($defaultFunction) { // don't attempt to stub twig's builtin function
+ return $defaultFunction;
53
}
54
55
return new TwigFunction((string)$name, $this->noop(), [
0 commit comments