Skip to content

Commit

Permalink
docs: update return type CacheMeServiceContract::get
Browse files Browse the repository at this point in the history
  • Loading branch information
h4kuna authored and pionl committed Jun 8, 2023
1 parent f5cb4ee commit 8f48750
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Cache/Contracts/CacheMeServiceContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ interface CacheMeServiceContract
* Tries to get the value from the cache using given strategy (by default tries memory and then repository). If
* value does not exist, creates it via callback. If repository supports tags it will use tagged store.
*
* @param Closure $getValue method is called with dependency injection
* @template T
* @param Closure(mixed...):T $getValue method is called with dependency injection
* @phpstan-param Closure(mixed,mixed,mixed,mixed,mixed,mixed):T $getValue
* @return T
*/
public function get(
string $key,
Expand Down
4 changes: 3 additions & 1 deletion src/Context/Services/ContextService.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public function is(AbstractIsContext $context, Closure $is): BoolContextValue
{
return $this->get(
context: $context,
createState: static fn (Container $container) => new BoolContextValue((bool) $container->call($is))
createState: static fn (Container $container): BoolContextValue => new BoolContextValue(
(bool) $container->call($is)
)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function execute(string $providerClass): AppServiceProviderEntity
{
return $this->cacheMeService->get(
key: 'app-service-provider-' . $providerClass,
getValue: static function (Application $application) use ($providerClass) {
getValue: static function (Application $application) use ($providerClass): AppServiceProviderEntity {
// TODO add ability to cache getProvider (laravel patch)
$serviceProvider = $application->getProvider($providerClass);
if ($serviceProvider instanceof ServiceProvider === false) {
Expand Down

0 comments on commit 8f48750

Please sign in to comment.