Skip to content

Commit 434e656

Browse files
committed
Downgrade larastan
1 parent bdb5aa5 commit 434e656

File tree

4 files changed

+108
-91
lines changed

4 files changed

+108
-91
lines changed

app/External/Export/ToDataPack.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,13 @@ public function process(int $barId, ?string $filename = null, ForceUnitConvertEn
7676

7777
$fullPath = $barId . '/' . $filename;
7878
Log::debug(sprintf('Moving datapack temporary file from "%s" to exports disk at "%s"', $tempFilePath, $fullPath));
79-
$this->file->disk('exports')->makeDirectory($barId);
80-
$this->file->disk('exports')->put($fullPath, file_get_contents($tempFilePath));
79+
$this->file->disk('exports')->makeDirectory((string) $barId);
80+
$contents = file_get_contents($tempFilePath);
81+
if ($contents === false) {
82+
throw new ExportFileNotCreatedException('Could not read temporary export file contents');
83+
}
84+
85+
$this->file->disk('exports')->put($fullPath, $contents);
8186

8287
return $fullPath;
8388
}

app/External/Export/ToRecipeType.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,13 @@ public function process(int $barId, ?string $filename = null, ExportTypeEnum $ty
6666

6767
$fullPath = $barId . '/' . $filename;
6868
Log::debug(sprintf('Moving temporary file from "%s" to exports disk at "%s"', $tempFilePath, $fullPath));
69-
$this->file->disk('exports')->makeDirectory($barId);
70-
$this->file->disk('exports')->put($fullPath, file_get_contents($tempFilePath));
69+
$this->file->disk('exports')->makeDirectory((string) $barId);
70+
$contents = file_get_contents($tempFilePath);
71+
if ($contents === false) {
72+
throw new ExportFileNotCreatedException('Could not read temporary export file contents');
73+
}
74+
75+
$this->file->disk('exports')->put($fullPath, $contents);
7176

7277
return $fullPath;
7378
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"barryvdh/laravel-debugbar": "^3.7",
4343
"driftingly/rector-laravel": "^2.1",
4444
"fakerphp/faker": "^1.9.1",
45-
"larastan/larastan": "^3.0",
45+
"larastan/larastan": "~3.7.0",
4646
"laravel/pint": "^1.0",
4747
"mockery/mockery": "^1.6",
4848
"nunomaduro/collision": "^8.6",

0 commit comments

Comments
 (0)