We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9bc8472 commit ee83c0cCopy full SHA for ee83c0c
src/Tag/Factory/PrefixedTagFactory.php
@@ -15,12 +15,15 @@ final class PrefixedTagFactory implements MutableFactoryInterface
15
public function __construct(
16
private readonly array $prefixes,
17
private readonly MutableFactoryInterface $delegate = new TagFactory(),
18
+ private readonly bool $allowNonPrefixedTags = true,
19
) {}
20
21
public function register(array|string $tags, FactoryInterface $delegate): void
22
{
23
foreach ((array) $tags as $tag) {
- $this->delegate->register($tag, $delegate);
24
+ if ($this->allowNonPrefixedTags) {
25
+ $this->delegate->register($tag, $delegate);
26
+ }
27
28
foreach ($this->prefixes as $prefix) {
29
$this->delegate->register($prefix . $tag, $delegate);
0 commit comments