Skip to content

Commit

Permalink
Renamed variable
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Oct 24, 2022
1 parent 9857d72 commit fff7a19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/UrlGeneration/ShardedPrefixPublicUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
final class ShardedPrefixPublicUrlGenerator implements PublicUrlGenerator
{
/** @var PathPrefixer[] */
private array $prefixers;
private array $prefixes;
private int $count;

/**
Expand All @@ -27,13 +27,13 @@ public function __construct(array $prefixes)
throw new InvalidArgumentException('At least one prefix is required.');
}

$this->prefixers = array_map(static fn (string $prefix) => new PathPrefixer($prefix, '/'), $prefixes);
$this->prefixes = array_map(static fn (string $prefix) => new PathPrefixer($prefix, '/'), $prefixes);
}

public function publicUrl(string $path, Config $config): string
{
$index = abs(crc32($path)) % $this->count;

return $this->prefixers[$index]->prefixPath($path);
return $this->prefixes[$index]->prefixPath($path);
}
}

0 comments on commit fff7a19

Please sign in to comment.