@@ -10,8 +10,7 @@ discard block |
||
| 10 | 10 | namespace Yep\Reflection; |
| 11 | 11 | |
| 12 | 12 | |
| 13 | -final class ReflectionClass extends \ReflectionClass |
|
| 14 | -{ |
|
| 13 | +final class ReflectionClass extends \ReflectionClass { |
|
| 15 | 14 | |
| 16 | 15 | /** @var object */ |
| 17 | 16 | protected $object; |
@@ -22,8 +21,7 @@ discard block |
||
| 22 | 21 | * @param object|mixed|null $object |
| 23 | 22 | * @throws \ReflectionException |
| 24 | 23 | */ |
| 25 | - public function __construct($class, $object = null) |
|
| 26 | - { |
|
| 24 | + public function __construct($class, $object = null) { |
|
| 27 | 25 | if (is_object($class) && !is_object($object)) { |
| 28 | 26 | $object = $class; |
| 29 | 27 | } |
@@ -48,8 +46,7 @@ discard block |
||
| 48 | 46 | } |
| 49 | 47 | |
| 50 | 48 | |
| 51 | - public function getObject() |
|
| 52 | - { |
|
| 49 | + public function getObject() { |
|
| 53 | 50 | return $this->object; |
| 54 | 51 | } |
| 55 | 52 | |
@@ -59,11 +56,11 @@ discard block |
||
| 59 | 56 | * @param mixed[] $arguments |
| 60 | 57 | * @return mixed |
| 61 | 58 | */ |
| 62 | - public function invokeMethod(string $method, array $arguments = []) |
|
| 63 | - { |
|
| 59 | + public function invokeMethod(string $method, array $arguments = []) { |
|
| 64 | 60 | try { |
| 65 | 61 | $reflection = $this->getMethod($method); |
| 66 | - } catch (\ReflectionException $e) { |
|
| 62 | + } |
|
| 63 | + catch (\ReflectionException $e) { |
|
| 67 | 64 | throw new \InvalidArgumentException('Reflection: Method "' . $method . '" does not exist: ' . $e->getMessage(), $e->getCode(), $e); |
| 68 | 65 | } |
| 69 | 66 | $reflection->setAccessible(true); |
@@ -80,7 +77,8 @@ discard block |
||
| 80 | 77 | { |
| 81 | 78 | try { |
| 82 | 79 | $reflection = $this->getProperty($property); |
| 83 | - } catch (\ReflectionException $e) { |
|
| 80 | + } |
|
| 81 | + catch (\ReflectionException $e) { |
|
| 84 | 82 | throw new \InvalidArgumentException('Reflection: Property "' . $property . '" does not exist: ' . $e->getMessage(), $e->getCode(), $e); |
| 85 | 83 | } |
| 86 | 84 | $reflection->setAccessible(true); |
@@ -93,11 +91,11 @@ discard block |
||
| 93 | 91 | /** |
| 94 | 92 | * @return mixed |
| 95 | 93 | */ |
| 96 | - public function getPropertyValue(string $property) |
|
| 97 | - { |
|
| 94 | + public function getPropertyValue(string $property) { |
|
| 98 | 95 | try { |
| 99 | 96 | $reflection = $this->getProperty($property); |
| 100 | - } catch (\ReflectionException $e) { |
|
| 97 | + } |
|
| 98 | + catch (\ReflectionException $e) { |
|
| 101 | 99 | throw new \InvalidArgumentException('Reflection: Property "' . $property . '" does not exist: ' . $e->getMessage(), $e->getCode(), $e); |
| 102 | 100 | } |
| 103 | 101 | $reflection->setAccessible(true); |