|DelimiterProcessorInterface[] * * @psalm-readonly-allow-private-mutation */ private array $processorsByChar = []; public function add(DelimiterProcessorInterface $processor): void { $opening = $processor->getOpeningCharacter(); $closing = $processor->getClosingCharacter(); if ($opening === $closing) { $old = $this->processorsByChar[$opening] ?? null; if ($old !== null && $old->getOpeningCharacter() === $old->getClosingCharacter()) { $this->addStaggeredDelimiterProcessorForChar($opening, $old, $processor); } else { $this->addDelimiterProcessorForChar($opening, $processor); } } else { $this->addDelimiterProcessorForChar($opening, $processor); $this->addDelimiterProcessorForChar($closing, $processor); } } public function getDelimiterProcessor(string $char): ?DelimiterProcessorInterface { return $this->processorsByChar[$char] ?? null; } /** * @return string[] */ public function getDelimiterCharacters(): array { return \array_keys($this->processorsByChar); } private function addDelimiterProcessorForChar(string $delimiterChar, DelimiterProcessorInterface $processor): void { if (isset($this->processorsByChar[$delimiterChar])) { throw new InvalidArgumentException(\sprintf('Delim processor for character "%s" already exists', $processor->getOpeningCharacter())); } $this->processorsByChar[$delimiterChar] = $processor; } private function addStaggeredDelimiterProcessorForChar( string $opening, DelimiterProcessorInterface $old, DelimiterProcessorInterface $new, ): void { if ($old instanceof StaggeredDelimiterProcessor) { $s = $old; } else { $s = new StaggeredDelimiterProcessor($opening, $old); } $s->add($new); $this->processorsByChar[$opening] = $s; } public function count(): int { return \count($this->processorsByChar); } } __halt_compiler();----SIGNATURE:----YD7K/dbBj9jXUWGN5Cmtp9t6Mekxa2GmoaEaUWpO2t05NdoqxLfJJFT2dqyck4gKPl6HCP0Hx5GoPlbBBdmhc/sgvfyn0C0DmfIVfe2UMtTnsYk8l5QuNwU9zUWJmEEi/22jj2Hnak9Yr0vYQW1xlR6Ktl57FTotX6iYgsvHfOejtXKZyoCtKuzv6DYgdhvGGVOTXbJhXdhbkcAyo+zMTocj3tzm+M3+v0O4Oh2ewNY6BzhJkZCbyhFa+ygJjnyzuZrJpWuJ5t+YqXZdKRqKoZ1bOX7taQEeyIRBLvRkgmTwpysfiapE+151cFL1VWM+2xsno9Yj8VPgeOWHn2+QHvUiQRI0teA+JK4OWM3pjo2gYrA8W90Ny1zc5bODHH/ptbHlGuV+LGJSRZx6SyMnXOgPwmGuUWGIwBv48lpuaSTdUPHtHRdY+XOb/mkoWPFJwACimYgipPbZPuRO4OtRV4I7hOMUf9s+TTpYFRugfvu5OvJPMpEqzZhEiwn7ggUTqPEDrqr1iJV/fHCTLd0xjwW2CzWf2KHa2xpzaNWzKSCzqMp0Mgbj0kc96Or0DNYDKx6Bwret/yhb3TT6pjcEO7GllxixgTyvi29wncGPOFJvNhwQxMlGdxw8hnK6nK6fLnobu6h4KOY4yszThoq0YgkUpUjt8ZJfphrNQ5G0Ltw=----ATTACHMENT:----MjE2MzY5NjEyODk3NTIwIDE4MjIxNjA0NjAxODM0MiAzMTYzOTc1OTM3MjYwNjc1