diff --git a/src/Commands/DeployLocal.php b/src/Commands/DeployLocal.php index 55d5fef..59a44cf 100644 --- a/src/Commands/DeployLocal.php +++ b/src/Commands/DeployLocal.php @@ -50,7 +50,7 @@ public function handle(): int return 2; } - $fullPath = base_path($this->option('path')); + $fullPath = base_path((string) $this->option('path')); if ($this->option('stop')) { return $this->stopDocker($fullPath); @@ -193,7 +193,7 @@ protected function runInDocker(string $workdir): int if ($result->failed()) { $this->error($result->errorOutput()); - return $result->exitCode(); + return $result->exitCode() ?? 0; } $this->info('Docker functions services running in the background.'); @@ -211,7 +211,7 @@ protected function stopDocker(string $workdir): int if ($result->failed()) { $this->error($result->errorOutput()); - return $result->exitCode(); + return $result->exitCode() ?? 0; } $this->info('Docker functions services stopped successfully.'); diff --git a/src/SidecarLayers.php b/src/SidecarLayers.php index 67583fa..4d24b56 100644 --- a/src/SidecarLayers.php +++ b/src/SidecarLayers.php @@ -31,6 +31,7 @@ public function fetch(LambdaFunction $function, array $arns, ProgressBar $progre $zipArchive = new ZipArchive(); + /** @var string $basePath */ $basePath = config('sidecar-local.path') ?? $function->package()->getBasePath(); $functionLayerDirectory = "{$basePath}/../layers/{$function->name()}"; @@ -45,7 +46,7 @@ public function fetch(LambdaFunction $function, array $arns, ProgressBar $progre $layerLocation = data_get($layerData, 'Content.Location'); - if (! $layerLocation || ! $this->filesystem->copy($layerLocation, $layerTmpFilePath)) { + if (! $layerLocation || ! is_string($layerLocation) || ! $this->filesystem->copy($layerLocation, $layerTmpFilePath)) { throw new \Exception("Cannot download layer for function '{$function->name()}'."); }