Skip to content

Commit b9ee99d

Browse files
committed
Fix PhpStan
1 parent df758d5 commit b9ee99d

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/Shared/Domain/Collection/EntityCollection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
namespace Ivy\Shared\Domain\Collection;
44

55
use Illuminate\Database\Eloquent\Collection;
6+
use Illuminate\Database\Eloquent\Model;
67
use Ivy\Shared\Base\Entity;
78
use Ivy\Shared\Presentation\Listing\PaginationState;
89
use Ivy\Shared\Presentation\Listing\SearchState;
910

1011
/**
11-
* @extends Collection<int|string, Entity>
12+
* @template TModel of Model
13+
* @extends Collection<int, TModel>
1214
*/
1315
class EntityCollection extends Collection
1416
{

src/Shared/Infrastructure/Database/EntityBuilder.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/**
1212
* @template TModel of Model
13-
* @extends Builder<Model>
13+
* @extends Builder<TModel>
1414
*/
1515
class EntityBuilder extends Builder
1616
{
@@ -44,10 +44,11 @@ public function searchState(): ?SearchState
4444

4545
/**
4646
* @param array<int, string> $columns
47+
* @return EntityCollection<TModel>
4748
*/
4849
public function get($columns = ['*']): EntityCollection
4950
{
50-
/** @var EntityCollection $collection */
51+
/** @var EntityCollection<TModel> $collection */
5152
$collection = parent::get($columns);
5253

5354
if ($this->paginationState !== null) {

src/Shared/Infrastructure/Service/ImageFileService.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ public function upload(): void
7979
IMAGETYPE_JPEG => imagejpeg($resource, $targetPath, 90),
8080
IMAGETYPE_PNG => imagepng($resource, $targetPath),
8181
IMAGETYPE_GIF => imagegif($resource, $targetPath),
82-
IMAGETYPE_WEBP => imagewebp($resource, $targetPath, 80),
83-
default => false,
82+
IMAGETYPE_WEBP => imagewebp($resource, $targetPath, 80)
8483
};
8584
};
8685

0 commit comments

Comments
 (0)