Skip to content

Commit

Permalink
Merge branch 'main' into 605--unpin-drupal
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdavidburns authored Jul 22, 2024
2 parents d75e944 + 091a5e7 commit afaeadf
Show file tree
Hide file tree
Showing 6 changed files with 524 additions and 444 deletions.
292 changes: 152 additions & 140 deletions .pnp.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion metapackages/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.15",
"chokidar": "^3.6.0",
"esbuild": "^0.21.5",
"esbuild": "^0.23.0",
"yargs": "^17.7.2"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"metapackages/*"
],
"devDependencies": {
"lerna": "^8.1.6"
"lerna": "^8.1.7"
}
}
18 changes: 11 additions & 7 deletions src/BinaryInstaller.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Lullabot\Drainpipe;

use Composer\Cache;
Expand Down Expand Up @@ -123,7 +125,7 @@ public static function getSubscribedEvents()
*
* @param Event $event the event to handle
*/
public function onPostInstallCmd(Event $event)
public function onPostInstallCmd(Event $event): void
{
$this->installBinaries($event);
}
Expand All @@ -133,7 +135,7 @@ public function onPostInstallCmd(Event $event)
*
* @param event $event The event to handle
*/
public function onPostUpdateCmd(Event $event)
public function onPostUpdateCmd(Event $event): void
{
$this->installBinaries($event);
}
Expand All @@ -143,7 +145,7 @@ public function onPostUpdateCmd(Event $event)
*
* @param event $event The event to handle
*/
public function installBinaries(Event $event)
public function installBinaries(Event $event): void
{
foreach ($this->binaries as $binary => $info) {
$platform = $this->platform;
Expand Down Expand Up @@ -184,9 +186,11 @@ public function installBinaries(Event $event)
* @param string $url
* The URL to download the binary
* @param string $sha
* The hash to validate
* @param string $hashalgo
* The hashing algorithm to use
*
* @see https://www.php.net/manual/en/function.hash-file.php
* @see https://www.php.net/manual/en/function.hash-file.php
*/
protected function installBinary($binary, $version, $url, $sha, $hashalgo = 'sha256'): void
{
Expand Down Expand Up @@ -258,12 +262,12 @@ protected function installBinary($binary, $version, $url, $sha, $hashalgo = 'sha
* Return if a file needs to be downloaded or not.
*
* @param string $cacheDestination The destination path to the downloaded file.
* @param $hashalgo The hash algorithm used to validate the file.
* @param $hash The hash used to validate the file.
* @param string $hashalgo The hash algorithm used to validate the file.
* @param string $hash The hash used to validate the file.
*
* @return bool True if the file needs to be downloaded again, false otherwise.
*/
private function needsDownload(string $cacheDestination, $hashalgo, $hash): bool {
private function needsDownload(string $cacheDestination, string $hashalgo, string $hash): bool {
return !$this->cache->isEnabled() || !file_exists($cacheDestination) || hash_file($hashalgo, $cacheDestination) !== $hash;
}
}
Loading

0 comments on commit afaeadf

Please sign in to comment.