addSchema('mentions', Expect::arrayOf( Expect::structure([ 'prefix' => Expect::string()->required(), 'pattern' => Expect::string()->assert($isAValidPartialRegex, 'Pattern must not include starting/ending delimiters (like "/")')->required(), 'generator' => Expect::anyOf( Expect::type(MentionGeneratorInterface::class), Expect::string(), Expect::type('callable') )->required(), ]) )); } public function register(EnvironmentBuilderInterface $environment): void { $mentions = $environment->getConfiguration()->get('mentions'); foreach ($mentions as $name => $mention) { if ($mention['generator'] instanceof MentionGeneratorInterface) { $environment->addInlineParser(new MentionParser($name, $mention['prefix'], $mention['pattern'], $mention['generator'])); } elseif (\is_string($mention['generator'])) { $environment->addInlineParser(MentionParser::createWithStringTemplate($name, $mention['prefix'], $mention['pattern'], $mention['generator'])); } elseif (\is_callable($mention['generator'])) { $environment->addInlineParser(MentionParser::createWithCallback($name, $mention['prefix'], $mention['pattern'], $mention['generator'])); } else { throw new InvalidConfigurationException(\sprintf('The "generator" provided for the "%s" MentionParser configuration must be a string template, callable, or an object that implements %s.', $name, MentionGeneratorInterface::class)); } } } } __halt_compiler();----SIGNATURE:----oqLLgylxKBmKBwoEYmtDfnlgUpqv4uinoj4vbM3zXMAehQtww4cmEtG3N5VtI/4m0WXQakIGdPxIeXCkpjArRuhTiMCXTKg3df4Jlqco/i71c2AvRkBjuHqVDPytBk8ZUerg4mNW7rfoMRRo40oBE2BPEb4GjC9OMM5FYViQ+hhXr87sJG5b+d/oPmcY3YSvCGpzKf5gRLDedL8e+chzXcAT3xdbjtZcTG+BL8V1+ojWXz8dJlKmXZ0y0UvyPwBvDWEn4ECEw9W6pj02s3O2FNGvUtOIOWLMwjODUV41nCeSOTX78yPtiWuuhTHK0FIXALNhZQAuTJqOPrFfe5fK4uSTT5cRgz1QmM0QpIRfdPIGj6JY0XfPnmXYOpKcevRfxPo5ubzXQYf4Np8z0Rg6IHC0JUHTUJoY2+jYHmC1RGHhSV77AOZQ1vhsmn+N7RyiOWHK2+Z3qWLKy77AjS7LBX3Gomk/wuMxX0YblZSnq6oaqvOTPDsrbQ7R2t4JyPPorH0yxEwbrZKMzB9BbKgZGiPe/1fQjh1lUFwwo7atk2bfu8zqA0wbjQ5kb+wwtaMpDm0EysNkI7cuVFmQKDZNKOExSFdv/WNmumfjiGAWjoN2mKFJ71jZBFs2RTx82q3eunpyud1/RhqL+iZmsxQXyaGz1Y0RiJvTdS8fnnEkMXk=----ATTACHMENT:----MTI0MzQ4Mjk4OTk4NTA1MyA5MDc5NTgzMDYxMTkyMDM3IDc4MjQ4MTMzODIxNzQzNzQ=