@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | // get_class() used to build a class name. |
44 | 44 | $legacyName = str_replace('\\', '_', $legacyName); |
45 | 45 | |
46 | - if(class_exists($legacyName)) |
|
46 | + if (class_exists($legacyName)) |
|
47 | 47 | { |
48 | 48 | return $legacyName; |
49 | 49 | } |
50 | 50 | |
51 | 51 | $nameNS = str_replace('_', '\\', $legacyName); |
52 | 52 | |
53 | - if(class_exists($nameNS)) |
|
53 | + if (class_exists($nameNS)) |
|
54 | 54 | { |
55 | 55 | return ltrim($nameNS, '\\'); |
56 | 56 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | $class = self::resolveClassName($legacyName); |
72 | 72 | |
73 | - if($class !== null) |
|
73 | + if ($class !== null) |
|
74 | 74 | { |
75 | 75 | return $class; |
76 | 76 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public static function requireClassExists(string $className) : void |
92 | 92 | { |
93 | - if(class_exists($className)) |
|
93 | + if (class_exists($className)) |
|
94 | 94 | { |
95 | 95 | return; |
96 | 96 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | self::requireClassExists($targetClass); |
116 | 116 | self::requireClassExists($extendsClass); |
117 | 117 | |
118 | - if(is_a($targetClass, $extendsClass, true)) |
|
118 | + if (is_a($targetClass, $extendsClass, true)) |
|
119 | 119 | { |
120 | 120 | return; |
121 | 121 | } |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | * @throws ClassNotExistsException |
137 | 137 | * @throws ClassNotImplementsException |
138 | 138 | */ |
139 | - public static function requireObjectInstanceOf(string $class, object $object, int $errorCode=0) |
|
139 | + public static function requireObjectInstanceOf(string $class, object $object, int $errorCode = 0) |
|
140 | 140 | { |
141 | - if(!class_exists($class) && !interface_exists($class) && !trait_exists($class)) |
|
141 | + if (!class_exists($class) && !interface_exists($class) && !trait_exists($class)) |
|
142 | 142 | { |
143 | 143 | throw new ClassNotExistsException($class, $errorCode); |
144 | 144 | } |
145 | 145 | |
146 | - if(is_a($object, $class, true)) |
|
146 | + if (is_a($object, $class, true)) |
|
147 | 147 | { |
148 | 148 | return $object; |
149 | 149 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public static function getClassLoader() : ClassLoader |
166 | 166 | { |
167 | - if(isset(self::$classLoader)) { |
|
167 | + if (isset(self::$classLoader)) { |
|
168 | 168 | return self::$classLoader; |
169 | 169 | } |
170 | 170 | |
@@ -178,14 +178,14 @@ discard block |
||
178 | 178 | |
179 | 179 | $autoloadFile = null; |
180 | 180 | |
181 | - foreach($paths as $path) |
|
181 | + foreach ($paths as $path) |
|
182 | 182 | { |
183 | - if(file_exists($path)) { |
|
183 | + if (file_exists($path)) { |
|
184 | 184 | $autoloadFile = $path; |
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
188 | - if($autoloadFile === null) { |
|
188 | + if ($autoloadFile === null) { |
|
189 | 189 | throw new ClassLoaderNotFoundException($paths); |
190 | 190 | } |
191 | 191 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | public function __construct(string $class, ?int $code = null, ?Throwable $previous = null) |
24 | 24 | { |
25 | - if($code === null || $code === 0) { |
|
25 | + if ($code === null || $code === 0) { |
|
26 | 26 | $code = self::ERROR_CODE; |
27 | 27 | } |
28 | 28 |