1 | <?php |
||
19 | final class ClassExistsChecker |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $className; |
||
25 | |||
26 | /** |
||
27 | * @var stdClass |
||
28 | */ |
||
29 | private $context; |
||
30 | |||
31 | /** |
||
32 | * @param string $className |
||
33 | * |
||
34 | * @return ClassExistsChecker |
||
35 | */ |
||
36 | public static function create($className) |
||
40 | |||
41 | /** |
||
42 | * ClassExistsChecker constructor. |
||
43 | * |
||
44 | * @param string $className |
||
45 | */ |
||
46 | public function __construct($className) |
||
50 | |||
51 | /** |
||
52 | * Check for class-existence while handling conditional definition of classes that extend from non-existent classes |
||
53 | * as it can happen with Magento Varien_Autoload that is using include to execute files for class definitions. |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | public function existsExtendsSafe() |
||
69 | |||
70 | /** |
||
71 | * @return stdClass |
||
72 | */ |
||
73 | private function startContext() |
||
83 | |||
84 | /** |
||
85 | * @param $context |
||
86 | * @param Exception $ex |
||
87 | * @return bool |
||
88 | */ |
||
89 | private function exceptionContext($context, Exception $ex) |
||
102 | |||
103 | /** |
||
104 | * @param $context |
||
105 | */ |
||
106 | private function endContext($context) |
||
115 | |||
116 | /** |
||
117 | * Method is called as last auto-loader (if all others have failed), so the class does not exists (is not |
||
118 | * resolve-able) |
||
119 | * |
||
120 | * @param $notFoundClass |
||
121 | * @throws CanNotAutoloadCollaboratorClassException |
||
122 | */ |
||
123 | public function autoloadTerminator($notFoundClass) |
||
144 | } |
||
145 |