Skip to content

Commit

Permalink
fix phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Dec 11, 2023
1 parent ea9c77c commit 869e207
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Commands/DeployLocal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.');
Expand All @@ -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.');
Expand Down
3 changes: 2 additions & 1 deletion src/SidecarLayers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()}";

Expand All @@ -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()}'.");
}

Expand Down

0 comments on commit 869e207

Please sign in to comment.