Skip to content
Snippets Groups Projects

Feature/cache resolvers

Merged Krzysztof Dyszczyk requested to merge feature/cache-resolvers into master
1 unresolved thread

Merge request reports

Checking pipeline status.

Merged by Krzysztof DyszczykKrzysztof Dyszczyk 5 years ago (Jun 12, 2019 12:38pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
27 28
28 29 /**
29 30 * CachedClient constructor.
31 *
30 32 * @param Client $decorated Decorated client
31 33 * @param CacheInterface $cache
32 34 */
33 35 public function __construct(Client $decorated, CacheInterface $cache)
34 36 {
35 37 $this->client = $decorated;
36 $this->cache = $cache;
37 $this->cacheDispatcher = new CacheDispatcher($cache, [new RequestCacheInfoResolver()]);
38 $this->cache = $cache;
39 $this->cacheDispatcher = new CacheDispatcher($cache, $this->getCacheInfoResolvers());
  • proponuję po prostu przekazać opcjonalny resolver lub tablicę resolverów do konstruktora (tak naprawdę zamiast tablicy, lepiej zastosować łańcuch odpowiedzialności, ale ponieważ już mamy tablicę to pewnie lepiej nie kombinować). Dzięki temu nie trzeba będzie na stałe wiązać się z faktem czy client jest jednocześnie fabryką resolverów - zwłaszcza, że idealnie nie powinien być.

    By Dyszczo on 2019-06-12T11:43:51 (imported from GitLab)

  • Please register or sign in to reply
  • Krzysztof Dyszczyk assigned to @grola and unassigned @Dyszczyk

    assigned to @grola and unassigned @Dyszczyk

    By Dyszczo on 2019-06-12T11:44:00 (imported from GitLab)

  • mentioned in commit 030ee36b

    By Grzegorz Rola on 2019-06-12T12:38:42 (imported from GitLab)

  • merged

    By Grzegorz Rola on 2019-06-12T12:38:42 (imported from GitLab)

  • Please register or sign in to reply
    Loading