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