Skip to content

Commit

Permalink
optional cache constructor argument
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed May 3, 2024
1 parent 398c204 commit 41cfb83
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ class Mapper extends Api
public readonly Client $client;
public readonly Converter $converter;
public readonly Middleware $middleware;
public ?CacheItemPoolInterface $cache = null;

public function __construct(Client $client)
{
public function __construct(
Client $client,
public ?CacheItemPoolInterface $cache = null,
) {
$this->middleware = new Middleware($this);
$this->client = $client->withMiddleware($this->middleware);
$this->converter = new Converter();
Expand Down

0 comments on commit 41cfb83

Please sign in to comment.