Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Runtime.php
Go to the documentation of this file.
1 <?php
7 
9 {
13  protected $_classReader;
14 
20  protected $_default = [];
21 
25  public function __construct(\Magento\Framework\Code\Reader\ClassReaderInterface $classReader = null)
26  {
27  $this->_classReader = $classReader ?: new \Magento\Framework\Code\Reader\ClassReader();
28  }
29 
36  public function has($type)
37  {
38  return class_exists($type) || interface_exists($type);
39  }
40 
47  public function getParents($type)
48  {
49  if (!class_exists($type)) {
50  return $this->_default;
51  }
52  return $this->_classReader->getParents($type) ?: $this->_default;
53  }
54 }
__construct(\Magento\Framework\Code\Reader\ClassReaderInterface $classReader=null)
Definition: Runtime.php:25
$type
Definition: item.phtml:13