@@ -32,56 +32,56 @@ |
||
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | - private static function _init($classname, $name){ |
|
36 | - return [ |
|
37 | - 'reflectionClass'=>$tmp=new \reflectionClass($classname), |
|
38 | - 'classname'=>$tmp->getName(), |
|
39 | - 'fullQualifiedClassname'=>str_replace('\\', '_', $classname), |
|
40 | - ]; |
|
41 | - } |
|
35 | + private static function _init($classname, $name){ |
|
36 | + return [ |
|
37 | + 'reflectionClass'=>$tmp=new \reflectionClass($classname), |
|
38 | + 'classname'=>$tmp->getName(), |
|
39 | + 'fullQualifiedClassname'=>str_replace('\\', '_', $classname), |
|
40 | + ]; |
|
41 | + } |
|
42 | 42 | |
43 | - private static function forwardInit($name,$Dir,\reflectionClass $reflectionClass){ |
|
44 | - self::createDir($Dir); |
|
45 | - return [ |
|
46 | - 'private_scope'=>false, |
|
47 | - 'name'=>trim($name), |
|
48 | - 'reflectionMethod'=>$reflectionClass->getConstructor(), |
|
49 | - 'notInstantiable'=>false, |
|
50 | - ]; |
|
51 | - } |
|
43 | + private static function forwardInit($name,$Dir,\reflectionClass $reflectionClass){ |
|
44 | + self::createDir($Dir); |
|
45 | + return [ |
|
46 | + 'private_scope'=>false, |
|
47 | + 'name'=>trim($name), |
|
48 | + 'reflectionMethod'=>$reflectionClass->getConstructor(), |
|
49 | + 'notInstantiable'=>false, |
|
50 | + ]; |
|
51 | + } |
|
52 | 52 | |
53 | - private static function _create($classname, $name){ |
|
54 | - extract(self::_init($classname, $name)); |
|
55 | - self::getTheRightDir($file, $Dir, $fullQualifiedClassname); |
|
56 | - $fileExists=file_exists($file); |
|
57 | - if (!function_exists($classname)&&!function_exists($name)) { |
|
58 | - if ($fileExists) { |
|
59 | - return include_once($file); |
|
60 | - } |
|
61 | - extract(self::forwardInit($name,$Dir,$reflectionClass)); |
|
62 | - if (is_null($reflectionMethod)||$notInstantiable=!$reflectionClass->isInstantiable()) { |
|
63 | - self::HandleNotInstantiableAndHasNoConstructor($Shortcut, $fullQualifiedClassname, $name, $notInstantiable, $classname); |
|
64 | - if ($Shortcut) { |
|
65 | - return self::pushAndShow($file, $Shortcut); |
|
66 | - } |
|
67 | - $private_scope=true; |
|
68 | - } |
|
53 | + private static function _create($classname, $name){ |
|
54 | + extract(self::_init($classname, $name)); |
|
55 | + self::getTheRightDir($file, $Dir, $fullQualifiedClassname); |
|
56 | + $fileExists=file_exists($file); |
|
57 | + if (!function_exists($classname)&&!function_exists($name)) { |
|
58 | + if ($fileExists) { |
|
59 | + return include_once($file); |
|
60 | + } |
|
61 | + extract(self::forwardInit($name,$Dir,$reflectionClass)); |
|
62 | + if (is_null($reflectionMethod)||$notInstantiable=!$reflectionClass->isInstantiable()) { |
|
63 | + self::HandleNotInstantiableAndHasNoConstructor($Shortcut, $fullQualifiedClassname, $name, $notInstantiable, $classname); |
|
64 | + if ($Shortcut) { |
|
65 | + return self::pushAndShow($file, $Shortcut); |
|
66 | + } |
|
67 | + $private_scope=true; |
|
68 | + } |
|
69 | 69 | |
70 | - self::getSignature($reflectionMethod, $signature, $parameters, $paramsNum, $count); |
|
70 | + self::getSignature($reflectionMethod, $signature, $parameters, $paramsNum, $count); |
|
71 | 71 | |
72 | - $hasInternal=''; |
|
73 | - if ($count) { |
|
74 | - self::BuildTheSwitch($hasInternal, $count, $paramsNum, $parameters, $classname); |
|
75 | - } |
|
76 | - self::useTheRightNameAndScope($Shortcut, $name, $fullQualifiedClassname, $signature, $private_scope, $classname); |
|
72 | + $hasInternal=''; |
|
73 | + if ($count) { |
|
74 | + self::BuildTheSwitch($hasInternal, $count, $paramsNum, $parameters, $classname); |
|
75 | + } |
|
76 | + self::useTheRightNameAndScope($Shortcut, $name, $fullQualifiedClassname, $signature, $private_scope, $classname); |
|
77 | 77 | |
78 | - self::handleInternals($Shortcut, $hasInternal, $parameters, $signature, $classname); |
|
78 | + self::handleInternals($Shortcut, $hasInternal, $parameters, $signature, $classname); |
|
79 | 79 | |
80 | - return self::pushAndShow($file, $Shortcut); |
|
81 | - } else { |
|
82 | - self::GetTheRightExceptionMessage($fileExists, $name, $fullQualifiedClassname); |
|
83 | - } |
|
84 | - } |
|
80 | + return self::pushAndShow($file, $Shortcut); |
|
81 | + } else { |
|
82 | + self::GetTheRightExceptionMessage($fileExists, $name, $fullQualifiedClassname); |
|
83 | + } |
|
84 | + } |
|
85 | 85 | |
86 | 86 | private static function getSignature(\ReflectionMethod $method, &$signature, &$parameters, &$paramsNum, &$count) |
87 | 87 | { |