|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:----WR6waWHGB+zx1KIzwnC1hTLJTzz2cXdwM9WG41btNKIHbhV6mikNuCypLSniX3rk0Nv+w5RmKfa+1w6MGD18O03ksgv/Y8KT5PHLrSqvk9uJI+6ROimt+oWjyZAa+8Rq0/5aYIXvbTUxisKVDTVonW9qfKEq4bOb7QMfAin8231w9NLulnMTCZpS3GuCvQRg8OyE6yPyoJJUY+O36RS2vWLTjiJtNZ8UHsLdFZGoVdM/HAIaCinWuj9Z0I/GPaQkfqRx1U/c3eA2jS341C2GKq0VVRkxaXydvnmUCSu+Wdx8dHNPJW9Q2zSxV49/Gw12+UF/v6A/QaaCtXdM5K++AtccwYA6T49XlVUKEKvpldZGvViRuG8gEItgzAqgSgPkLWCEv8DN0u3bQ0axy8jelZZNyO9eYKRbXU76WtzyK0V69HisfkjpwbDKjhGZPogFF5ndaNTd6IVyRzciqd1j3t0xMov2ClRDH7ZojUICT6p9t2TN58Jns1dLfCkMs2ORbh+cqIhNRix9KkhkAswMJrDame2uUI7d62bSNHOSMuTRUP2rT/4RBFoqfdSUq+ZtqZkHikR0ZdVIMBjpbt0XffTdLQu63hefooF21ygFJSeU1NCNelYi1Nn04OqokLMGJMTCGLcjLQbYG+Cunvso/v9g+efW8g0yQ6YmMV+r+0w=----ATTACHMENT:----MTU5MzI0MTgxMzIwMjU4MiA1MTYyNTIxOTgwNDUzMzQgMjYyOTYzNTU2MDMyOTEz