Skip to content

Commit fbecc37

Browse files
committed
Simplify surrogate key generation by refactoring str_replace usage in SurrogateKeys constructor
1 parent e204ef3 commit fbecc37

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/SurrogateKeys.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ final class SurrogateKeys
2626

2727
public function __construct(AbstractUri $uri)
2828
{
29-
$uriKey = sprintf('%s_%s', str_replace(DIRECTORY_SEPARATOR, '_', $uri->path), http_build_query($uri->query));
29+
$path = str_replace('/', '_', $uri->path);
30+
$uriKey = sprintf('%s_%s', $path, http_build_query($uri->query));
3031
$this->surrogateKeys = [$uriKey];
3132
$this->uriTag = new UriTag();
3233
}

0 commit comments

Comments
 (0)