Skip to content

Commit ee83c0c

Browse files
committed
Add PrefixedTagFactory::$allowNonPrefixedTags config parameter
1 parent 9bc8472 commit ee83c0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Tag/Factory/PrefixedTagFactory.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ final class PrefixedTagFactory implements MutableFactoryInterface
1515
public function __construct(
1616
private readonly array $prefixes,
1717
private readonly MutableFactoryInterface $delegate = new TagFactory(),
18+
private readonly bool $allowNonPrefixedTags = true,
1819
) {}
1920

2021
public function register(array|string $tags, FactoryInterface $delegate): void
2122
{
2223
foreach ((array) $tags as $tag) {
23-
$this->delegate->register($tag, $delegate);
24+
if ($this->allowNonPrefixedTags) {
25+
$this->delegate->register($tag, $delegate);
26+
}
2427

2528
foreach ($this->prefixes as $prefix) {
2629
$this->delegate->register($prefix . $tag, $delegate);

0 commit comments

Comments
 (0)