Skip to content

Commit

Permalink
Fix generating routes
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrooo committed Jun 26, 2023
1 parent d573a35 commit c647820
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Ouzo/Core/Uri/UriGeneratorTemplates.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Ouzo\Uri;

use Ouzo\Utilities\Arrays;
use Ouzo\Utilities\Strings;

class UriGeneratorTemplates
{
Expand All @@ -20,6 +21,9 @@ public static function replaceTemplate(string $namesList, string $methodsList, s

private static function replace(string $template, string $pattern, ?string $replacement): string
{
if (Strings::isBlank($replacement)) {
$replacement = Strings::EMPTY_STRING;
}
return str_replace(["/*{{$pattern}}*/", "%{{$pattern}}"], $replacement, $template);
}

Expand Down Expand Up @@ -115,4 +119,4 @@ private static function checkParameterTemplate(string $param): string
TEMPLATE;
}
}
}

0 comments on commit c647820

Please sign in to comment.