Skip to content

Commit

Permalink
Merge pull request #27 from apple-x-co/qiq-1.1.0
Browse files Browse the repository at this point in the history
Fix HelperLocator
  • Loading branch information
koriym authored Mar 20, 2023
2 parents b139b46 + b6fb268 commit 252f0d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/HelperLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@
use Qiq\Exception;
use Qiq\Helper;

use function array_merge;
use function class_exists;
use function function_exists;

class HelperLocator extends \Qiq\HelperLocator
{
public static function new(Escape|null $escape = null): self
public static function new(Escape|null $escape = null, array $factories = []): static
{
$escape ??= new Escape('utf-8');

return new static([
return new static(array_merge([
'a' => static fn () => new Helper\EscapeAttr($escape),
'c' => static fn () => new Helper\EscapeCss($escape),
'escape' => static fn () => $escape,
'h' => static fn () => new Helper\EscapeHtml($escape),
'u' => static fn () => new Helper\EscapeUrl($escape),
], $escape);
], $factories), $escape);
}

/** @var array<object> */
Expand Down

0 comments on commit 252f0d4

Please sign in to comment.