Skip to content

Commit

Permalink
added: akeneo item build
Browse files Browse the repository at this point in the history
  • Loading branch information
Thijzer committed Dec 20, 2024
1 parent 7fefc7d commit 487bc71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Component/Common/Utils/ValueFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public static function format(string $format, array $values): string
return strtr($format, $replacements);
}

public static function getKeys(string $format): array
{
preg_match_all('/%([a-zA-Z0-9_]+)%/', $format, $matches);
return $matches[1] ?? [];
}

public static function recursiveFormat(string $format, array $values): string
{
foreach ($values as $value) {
Expand Down

0 comments on commit 487bc71

Please sign in to comment.