Skip to content

Commit

Permalink
Refactor method param type to reusable annotation
Browse files Browse the repository at this point in the history
Replaced inline array type annotation with a reusable Props type definition. This change reduces redundancy and improves maintainability by ensuring that the data structure is consistent across the class.
  • Loading branch information
koriym committed Sep 7, 2024
1 parent a6b3342 commit ceb15e3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/ResourceStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
use function sprintf;
use function strtoupper;

/**
* @psalm-type Props = array{
* logger: RepositoryLoggerInterface,
* purger:PurgerInterface,
* uriTag: UriTag,
* saver: ResourceStorageSaver,
* roProvider:ProviderInterface<TagAwareAdapterInterface>,
* etagProvider: ProviderInterface<TagAwareAdapterInterface>
* }
*/
final class ResourceStorage implements ResourceStorageInterface
{
/**
Expand Down Expand Up @@ -263,14 +273,7 @@ public function __serialize(): array
}

/**
* @param array{
* logger: RepositoryLoggerInterface,
* purger:PurgerInterface,
* uriTag: UriTag,
* saver: ResourceStorageSaver,
* roProvider:ProviderInterface<TagAwareAdapterInterface>,
* etagProvider: ProviderInterface<TagAwareAdapterInterface>
* } $data
* @param Props $data
*
* @return void
*/
Expand Down

0 comments on commit ceb15e3

Please sign in to comment.