| @@ 261-275 (lines=15) @@ | ||
| 258 | * |
|
| 259 | * @return mixed |
|
| 260 | */ |
|
| 261 | private function makeObject($className, array $arguments = []) |
|
| 262 | { |
|
| 263 | try { |
|
| 264 | $reflection = new \ReflectionClass($className); |
|
| 265 | $reflectionMethod = new \ReflectionMethod($className, '__construct'); |
|
| 266 | ||
| 267 | if ($reflectionMethod->getNumberOfParameters() === 0) { |
|
| 268 | return new $className; |
|
| 269 | } else { |
|
| 270 | return $reflection->newInstanceArgs($arguments); |
|
| 271 | } |
|
| 272 | } catch (Exception $e) { |
|
| 273 | return false; |
|
| 274 | } |
|
| 275 | } |
|
| 276 | } |
|
| 277 | ||
| @@ 205-219 (lines=15) @@ | ||
| 202 | * |
|
| 203 | * @return mixed |
|
| 204 | */ |
|
| 205 | private function makeObject($className, array $arguments = []) |
|
| 206 | { |
|
| 207 | try { |
|
| 208 | $reflection = new \ReflectionClass($className); |
|
| 209 | $reflectionMethod = new \ReflectionMethod($className, '__construct'); |
|
| 210 | ||
| 211 | if ($reflectionMethod->getNumberOfParameters() === 0) { |
|
| 212 | return new $className; |
|
| 213 | } else { |
|
| 214 | return $reflection->newInstanceArgs($arguments); |
|
| 215 | } |
|
| 216 | } catch (Exception $e) { |
|
| 217 | return false; |
|
| 218 | } |
|
| 219 | } |
|
| 220 | } |
|