/** * {@inheritDoc} */ public function process(ProcessableInterface $processable, array $variables) { $fakerRegex = '<(?:(?<locale>[a-z]+(?:_[a-z]+)?):)?(?<name>[a-z0-9_]+?)?\\((?<args>(?:[^)]*|\\)(?!>))*)\\)>'; if ($processable->valueMatches('#^' . $fakerRegex . '$#i')) { return $this->replacePlaceholder($processable->getMatches(), $variables); } else { // format placeholders inline return preg_replace_callback('#' . $fakerRegex . '#i', function ($matches) use($variables) { return $this->replacePlaceholder($matches, $variables); }, $processable->getValue()); } }