private function replaceWildcards($string, array $replacements) { foreach ($replacements as $replacement) { $pos = strpos($string, self::WILDCARD); if ($pos !== false) { $string = substr_replace($string, $replacement, $pos, 1); } } return $string; }