Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ScopeResolverPool.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Framework\App;
8 
13 {
17  protected $_scopeResolvers = [];
18 
22  public function __construct(
23  array $scopeResolvers = []
24  ) {
25  $this->_scopeResolvers = $scopeResolvers;
26  }
27 
35  public function get($scopeType)
36  {
37  if (!isset($this->_scopeResolvers[$scopeType]) ||
38  !($this->_scopeResolvers[$scopeType] instanceof \Magento\Framework\App\ScopeResolverInterface)
39  ) {
40  throw new \InvalidArgumentException("Invalid scope type '{$scopeType}'");
41  }
42  return $this->_scopeResolvers[$scopeType];
43  }
44 }