composer package updates
[openemr.git] / vendor / zendframework / zend-cache / src / PatternPluginManager / PatternPluginManagerV2Polyfill.php
blob47eb85974330e989cdc2487b1e295e4e9797c7b0
1 <?php
2 /**
3 * @see https://github.com/zendframework/zend-cache for the canonical source repository
4 * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (http://www.zend.com)
5 * @license https://github.com/zendframework/zend-cache/blob/master/LICENSE.md New BSD License
6 */
8 namespace Zend\Cache\PatternPluginManager;
10 use Zend\Cache\Pattern;
11 use Zend\ServiceManager\AbstractPluginManager;
12 use Zend\ServiceManager\Factory\InvokableFactory;
14 /**
15 * zend-servicemanager v2-compatible plugin manager implementation for cache pattern adapters.
17 * Enforces that retrieved adapters are instances of
18 * Pattern\PatternInterface. Additionally, it registers a number of default
19 * patterns available.
21 class PatternPluginManagerV2Polyfill extends AbstractPluginManager
23 use PatternPluginManagerTrait;
25 protected $aliases = [
26 'callback' => Pattern\CallbackCache::class,
27 'Callback' => Pattern\CallbackCache::class,
28 'capture' => Pattern\CaptureCache::class,
29 'Capture' => Pattern\CaptureCache::class,
30 'class' => Pattern\ClassCache::class,
31 'Class' => Pattern\ClassCache::class,
32 'object' => Pattern\ObjectCache::class,
33 'Object' => Pattern\ObjectCache::class,
34 'output' => Pattern\OutputCache::class,
35 'Output' => Pattern\OutputCache::class,
38 protected $factories = [
39 Pattern\CallbackCache::class => InvokableFactory::class,
40 Pattern\CaptureCache::class => InvokableFactory::class,
41 Pattern\ClassCache::class => InvokableFactory::class,
42 Pattern\ObjectCache::class => InvokableFactory::class,
43 Pattern\OutputCache::class => InvokableFactory::class,
45 // v2 normalized FQCNs
46 'zendcachepatterncallbackcache' => InvokableFactory::class,
47 'zendcachepatterncapturecache' => InvokableFactory::class,
48 'zendcachepatternclasscache' => InvokableFactory::class,
49 'zendcachepatternobjectcache' => InvokableFactory::class,
50 'zendcachepatternoutputcache' => InvokableFactory::class,
53 /**
54 * Don't share by default
56 * @var bool
58 protected $shareByDefault = false;
60 /**
61 * Don't share by default
63 * @var bool
65 protected $sharedByDefault = false;
67 /**
68 * @var string
70 protected $instanceOf = Pattern\PatternInterface::class;
72 /**
73 * Override get to inject options as PatternOptions instance.
75 * {@inheritDoc}
77 public function get($plugin, $options = [], $usePeeringServiceManagers = true)
79 if (empty($options)) {
80 return parent::get($plugin, [], $usePeeringServiceManagers);
83 $plugin = parent::get($plugin, [], $usePeeringServiceManagers);
84 $plugin->setOptions(new Pattern\PatternOptions($options));
85 return $plugin;