Skip to content

Commit

Permalink
Unify typehints of parameter $name in methods addFilter()
Browse files Browse the repository at this point in the history
On nette forum in this post: https://forum.nette.org/cs/36685-latte-addfilter-neni-tam-chyba#p227757 was reported error - mismatch between typehints of parameter $name in methods addFilter() in Nette\Bridges\ApplicationLatte\Template and Latte\Engine, the correct typehint is defined by typehint of second parameter of php function preg_match() which is string. Consequently the correct typehint of parameter $name in method Nette\Bridges\ApplicationLatte\Template::addFilter() is pure string not nullable string
  • Loading branch information
mildabre authored Oct 12, 2024
1 parent 2fa9a9d commit fab5d47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationLatte/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __toString(): string
/**
* Registers run-time filter.
*/
public function addFilter(?string $name, callable $callback): static
public function addFilter(string $name, callable $callback): static
{
$this->latte->addFilter($name, $callback);
return $this;
Expand Down

0 comments on commit fab5d47

Please sign in to comment.