Skip to content

Commit

Permalink
Pull request feedback
Browse files Browse the repository at this point in the history
Co-authored-by: Jérôme Tamarelle <[email protected]>
  • Loading branch information
2 people authored and alcohol committed Sep 18, 2023
1 parent 501da22 commit b4bc345
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Builder/ArchiveBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public function dump(array $packages): void
$distUrl = sprintf('%s/%s/%s/%s', $endpoint, $this->config['archive']['directory'], $intermediatePath, $archive);
$package->setDistType($archiveFormat);
$package->setDistUrl($distUrl);
$hasedPath = $includeArchiveChecksum ? hash_file('sha1', $path) : false;
$package->setDistSha1Checksum(false !== $hasedPath ? $hasedPath : null);
$hasedPath = hash_file('sha1', $path);
$package->setDistSha1Checksum($includeArchiveChecksum ? (is_string($hasedPath) ? $hasedPath : null) : null);
$package->setDistReference($package->getSourceReference());

if ($renderProgress) {
Expand Down
2 changes: 1 addition & 1 deletion src/PackageSelection/PackageSelection.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function load(): array
$baseUrlLength = strlen($baseUrl);

foreach ($rootConfig['providers'] as $package => $provider) {
$file = (string) str_replace(['%package%', '%hash%'], [$package, $provider['sha256']], $rootConfig['providers-url']);
$file = str_replace(['%package%', '%hash%'], [$package, $provider['sha256']], (string) $rootConfig['providers-url']);

if (strlen($baseUrl) > 0 && substr($file, 0, $baseUrlLength) === $baseUrl) {
$file = substr($file, $baseUrlLength);
Expand Down

0 comments on commit b4bc345

Please sign in to comment.