@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | {
|
| 31 | 31 | // Use default autoload implementation |
| 32 | 32 | // Register given function as __autoload() implementation |
| 33 | - spl_autoload_register(function($class){
|
|
| 33 | + spl_autoload_register(function($class) {
|
|
| 34 | 34 | $this->getRegisterCallBackVar($class); |
| 35 | 35 | $this->registerCallBackFormatter(); |
| 36 | 36 | }); |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | private function getRegisterCallBackVar($class) :void |
| 46 | 46 | {
|
| 47 | - if(defined('root')){
|
|
| 47 | + if (defined('root')) {
|
|
| 48 | 48 | |
| 49 | 49 | $this->class = $class; |
| 50 | 50 | $this->classPath = root.''.DIRECTORY_SEPARATOR.''.$this->class.''.self::FileExtension; |
| 51 | - $this->classPath = str_replace("\\","/",$this->classPath);
|
|
| 51 | + $this->classPath = str_replace("\\", "/", $this->classPath);
|
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * return mixed |
| 59 | 59 | */ |
| 60 | - private function registerCallBackFormatter () |
|
| 60 | + private function registerCallBackFormatter() |
|
| 61 | 61 | {
|
| 62 | - $this->checkAliasClassFormatter($this->classPath,function() {
|
|
| 62 | + $this->checkAliasClassFormatter($this->classPath, function() {
|
|
| 63 | 63 | require($this->classPath); |
| 64 | 64 | }); |
| 65 | 65 | } |
@@ -71,16 +71,16 @@ discard block |
||
| 71 | 71 | * @param $callback |
| 72 | 72 | * @return mixed |
| 73 | 73 | */ |
| 74 | - private function checkAliasClassFormatter($class,$callback) |
|
| 74 | + private function checkAliasClassFormatter($class, $callback) |
|
| 75 | 75 | {
|
| 76 | 76 | $systemApp = []; |
| 77 | 77 | |
| 78 | - if(defined('app')){
|
|
| 78 | + if (defined('app')) {
|
|
| 79 | 79 | $systemApp = (new ClassAliasGroup())->handle(); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - if(!file_exists($class)){
|
|
| 83 | - $this->getAliasClassFormatter($class,$systemApp); |
|
| 82 | + if (!file_exists($class)) {
|
|
| 83 | + $this->getAliasClassFormatter($class, $systemApp); |
|
| 84 | 84 | return false; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | * @param $class |
| 94 | 94 | * @param $systemApp |
| 95 | 95 | */ |
| 96 | - private function getAliasClassFormatter($class,$systemApp) |
|
| 96 | + private function getAliasClassFormatter($class, $systemApp) |
|
| 97 | 97 | {
|
| 98 | - $this->setAliasClassGroup($class,$systemApp); |
|
| 98 | + $this->setAliasClassGroup($class, $systemApp); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -104,14 +104,14 @@ discard block |
||
| 104 | 104 | * @param $class |
| 105 | 105 | * @param $systemApp |
| 106 | 106 | */ |
| 107 | - private function setAliasClassGroup($class,$systemApp) |
|
| 107 | + private function setAliasClassGroup($class, $systemApp) |
|
| 108 | 108 | {
|
| 109 | - $alias = str_replace(root.''.DIRECTORY_SEPARATOR.'','',$class); |
|
| 110 | - $alias = str_replace(self::FileExtension,'',$alias); |
|
| 109 | + $alias = str_replace(root.''.DIRECTORY_SEPARATOR.'', '', $class); |
|
| 110 | + $alias = str_replace(self::FileExtension, '', $alias); |
|
| 111 | 111 | |
| 112 | 112 | //set class_alias groups |
| 113 | - if(array_key_exists($alias,$systemApp)){
|
|
| 114 | - class_alias($systemApp[$alias],$alias); |
|
| 113 | + if (array_key_exists($alias, $systemApp)) {
|
|
| 114 | + class_alias($systemApp[$alias], $alias); |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | } |