@@ -41,8 +41,7 @@ discard block |
||
| 41 | 41 | if (!static::$reflectionComposite) |
| 42 | 42 | { |
| 43 | 43 | static::$reflectionComposite = |
| 44 | - ReflectionCompositeFactory::fromClassName |
|
| 45 | - ( |
|
| 44 | + ReflectionCompositeFactory::fromClassName( |
|
| 46 | 45 | get_called_class() |
| 47 | 46 | ) |
| 48 | 47 | ->build(); |
@@ -54,8 +53,7 @@ discard block |
||
| 54 | 53 | /** |
| 55 | 54 | * Set the default ReflectionComposite for this class |
| 56 | 55 | */ |
| 57 | - protected static function setDefaultReflectionComposite |
|
| 58 | - ( |
|
| 56 | + protected static function setDefaultReflectionComposite( |
|
| 59 | 57 | ReflectionComposite $defaultReflectionComposite |
| 60 | 58 | ) |
| 61 | 59 | { |
@@ -28,13 +28,11 @@ |
||
| 28 | 28 | * |
| 29 | 29 | * @param Throwable $previous The exception which caused this |
| 30 | 30 | */ |
| 31 | - public function __construct |
|
| 32 | - ( |
|
| 31 | + public function __construct( |
|
| 33 | 32 | Throwable $previous = null |
| 34 | 33 | ) |
| 35 | 34 | { |
| 36 | - parent::__construct |
|
| 37 | - ( |
|
| 35 | + parent::__construct( |
|
| 38 | 36 | 'Cannot serialize object containing generics without ' |
| 39 | 37 | . 'context', |
| 40 | 38 | 0, |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * |
| 55 | 55 | * @param ReflectionCompositeProviderInterface $default |
| 56 | 56 | */ |
| 57 | - public static function setDefault |
|
| 58 | - ( |
|
| 57 | + public static function setDefault( |
|
| 59 | 58 | ReflectionCompositeProviderInterface $default |
| 60 | 59 | ) |
| 61 | 60 | { |
@@ -90,8 +89,7 @@ discard block |
||
| 90 | 89 | { |
| 91 | 90 | $this->cache[$classname] = |
| 92 | 91 | ( |
| 93 | - ReflectionCompositeFactory::fromClassName |
|
| 94 | - ( |
|
| 92 | + ReflectionCompositeFactory::fromClassName( |
|
| 95 | 93 | $classname |
| 96 | 94 | ) |
| 97 | 95 | ) |
@@ -69,8 +69,7 @@ discard block |
||
| 69 | 69 | { |
| 70 | 70 | if (!isset($args[$i])) |
| 71 | 71 | { |
| 72 | - throw new MissingRequiredParameterException |
|
| 73 | - ( |
|
| 72 | + throw new MissingRequiredParameterException( |
|
| 74 | 73 | get_class($this->object), |
| 75 | 74 | $property->name |
| 76 | 75 | ); |
@@ -148,14 +147,12 @@ discard block |
||
| 148 | 147 | { |
| 149 | 148 | if (!$this->reflect->properties->containsKey($property)) |
| 150 | 149 | { |
| 151 | - throw new CannotWritePropertyException |
|
| 152 | - ( |
|
| 150 | + throw new CannotWritePropertyException( |
|
| 153 | 151 | get_class($this->object), $property |
| 154 | 152 | ); |
| 155 | 153 | } |
| 156 | 154 | |
| 157 | - $this->setAnyValue |
|
| 158 | - ( |
|
| 155 | + $this->setAnyValue( |
|
| 159 | 156 | $this->reflect->properties[$property], |
| 160 | 157 | $value |
| 161 | 158 | ); |
@@ -193,8 +190,7 @@ discard block |
||
| 193 | 190 | * @param ScalarType $valueType The scalar type |
| 194 | 191 | * @param mixed $value The value to set |
| 195 | 192 | */ |
| 196 | - private function setScalarValue |
|
| 197 | - ( |
|
| 193 | + private function setScalarValue( |
|
| 198 | 194 | ReflectionProperty $property, |
| 199 | 195 | ScalarType $valueType, |
| 200 | 196 | $value |
@@ -204,16 +200,14 @@ discard block |
||
| 204 | 200 | |
| 205 | 201 | if (is_scalar($value)) |
| 206 | 202 | { |
| 207 | - $this->setRawValue |
|
| 208 | - ( |
|
| 203 | + $this->setRawValue( |
|
| 209 | 204 | $property->name, |
| 210 | 205 | $property->type->cast($value) |
| 211 | 206 | ); |
| 212 | 207 | } |
| 213 | 208 | elseif (is_object($value) && method_exists([$value, $method])) |
| 214 | 209 | { |
| 215 | - $this->setScalarValue |
|
| 216 | - ( |
|
| 210 | + $this->setScalarValue( |
|
| 217 | 211 | $property, |
| 218 | 212 | $valueType, |
| 219 | 213 | $value->$method() |
@@ -231,14 +225,12 @@ discard block |
||
| 231 | 225 | * @param ReflectionProperty $property The property being set |
| 232 | 226 | * @param AbstractType $valueType The value being set |
| 233 | 227 | */ |
| 234 | - private function throwError |
|
| 235 | - ( |
|
| 228 | + private function throwError( |
|
| 236 | 229 | ReflectionProperty $property, |
| 237 | 230 | AbstractType $valueType |
| 238 | 231 | ) |
| 239 | 232 | { |
| 240 | - throw new IllegalPropertyTypeException |
|
| 241 | - ( |
|
| 233 | + throw new IllegalPropertyTypeException( |
|
| 242 | 234 | get_class($this->object), |
| 243 | 235 | $property->name, |
| 244 | 236 | $property->type, |
@@ -44,8 +44,7 @@ |
||
| 44 | 44 | { |
| 45 | 45 | if (!$pair instanceof OrderedPair) |
| 46 | 46 | { |
| 47 | - $pair = new OrderedPair |
|
| 48 | - ( |
|
| 47 | + $pair = new OrderedPair( |
|
| 49 | 48 | $this->size(), |
| 50 | 49 | $pair->key, |
| 51 | 50 | $pair->value |
@@ -64,8 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public static function fromName(string $class, string $method) |
| 66 | 66 | { |
| 67 | - return new static(new PHPNativeReflectionMethod |
|
| 68 | - ( |
|
| 67 | + return new static(new PHPNativeReflectionMethod( |
|
| 69 | 68 | $class, $method |
| 70 | 69 | )); |
| 71 | 70 | } |
@@ -89,8 +88,7 @@ discard block |
||
| 89 | 88 | { |
| 90 | 89 | $this->typeParser = new TypeParser($parent); |
| 91 | 90 | $this->accessor->setRawValue('owner', $parent); |
| 92 | - $this->accessor->setRawValue |
|
| 93 | - ( |
|
| 91 | + $this->accessor->setRawValue( |
|
| 94 | 92 | 'name', |
| 95 | 93 | $this->reflector->getName() |
| 96 | 94 | ); |
@@ -118,8 +116,7 @@ discard block |
||
| 118 | 116 | $type = $this->reflector->getReturnType(); |
| 119 | 117 | if ($type) |
| 120 | 118 | { |
| 121 | - $this->accessor->setRawValue |
|
| 122 | - ( |
|
| 119 | + $this->accessor->setRawValue( |
|
| 123 | 120 | 'nativeReturnType', |
| 124 | 121 | !$type->isBuiltin() ? '\\' . $type : (string)$type |
| 125 | 122 | ); |
@@ -136,13 +133,11 @@ discard block |
||
| 136 | 133 | */ |
| 137 | 134 | protected function initParams() |
| 138 | 135 | { |
| 139 | - $this->accessor->setRawValue |
|
| 140 | - ( |
|
| 136 | + $this->accessor->setRawValue( |
|
| 141 | 137 | 'parameters', |
| 142 | 138 | new FixedList(count($this->reflector->getParameters())) |
| 143 | 139 | ); |
| 144 | - $this->accessor->setRawValue |
|
| 145 | - ( |
|
| 140 | + $this->accessor->setRawValue( |
|
| 146 | 141 | 'nativeParameters', |
| 147 | 142 | new FixedList(count($this->reflector->getParameters())) |
| 148 | 143 | ); |
@@ -163,8 +158,7 @@ discard block |
||
| 163 | 158 | |
| 164 | 159 | if (!$this->parameters->containsKey($param)) |
| 165 | 160 | { |
| 166 | - throw new \Exception |
|
| 167 | - ( |
|
| 161 | + throw new \Exception( |
|
| 168 | 162 | 'Tried to set param annotation for non existant ' |
| 169 | 163 | . 'parameter: ' . $param |
| 170 | 164 | ); |
@@ -177,8 +171,7 @@ discard block |
||
| 177 | 171 | |
| 178 | 172 | if (!$comparator->compatible($nativeType, $type)) |
| 179 | 173 | { |
| 180 | - throw new \Exception |
|
| 181 | - ( |
|
| 174 | + throw new \Exception( |
|
| 182 | 175 | 'Types are incompatible for: ' |
| 183 | 176 | . $this->reflector->getName() . '::' . $items[1] |
| 184 | 177 | ); |
@@ -193,8 +186,7 @@ discard block |
||
| 193 | 186 | * |
| 194 | 187 | * @param PHPNativeReflectionParameter $reflect |
| 195 | 188 | */ |
| 196 | - protected function addParameter |
|
| 197 | - ( |
|
| 189 | + protected function addParameter( |
|
| 198 | 190 | PHPNativeReflectionParameter $reflect |
| 199 | 191 | ) |
| 200 | 192 | : void |
@@ -41,8 +41,7 @@ discard block |
||
| 41 | 41 | return static::$defaultHashProducer; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - public static function setDefaultHashProducer |
|
| 45 | - ( |
|
| 44 | + public static function setDefaultHashProducer( |
|
| 46 | 45 | HashProducerInterface $hashProducer |
| 47 | 46 | ) |
| 48 | 47 | : HashProducerInterface |
@@ -60,8 +59,7 @@ discard block |
||
| 60 | 59 | */ |
| 61 | 60 | protected $hashProducer; |
| 62 | 61 | |
| 63 | - public function __construct |
|
| 64 | - ( |
|
| 62 | + public function __construct( |
|
| 65 | 63 | ?HashProducerInterface $hashProducer = null |
| 66 | 64 | ) |
| 67 | 65 | { |
@@ -45,8 +45,7 @@ |
||
| 45 | 45 | /** |
| 46 | 46 | * {@inheritDoc} |
| 47 | 47 | */ |
| 48 | - public function splice |
|
| 49 | - ( |
|
| 48 | + public function splice( |
|
| 50 | 49 | int $offset, |
| 51 | 50 | ?int $length = null, |
| 52 | 51 | array $replacement = [] |
@@ -43,8 +43,7 @@ |
||
| 43 | 43 | * @param int $length The number of elements to remove |
| 44 | 44 | * @param array $items Items to add |
| 45 | 45 | */ |
| 46 | - public function splice |
|
| 47 | - ( |
|
| 46 | + public function splice( |
|
| 48 | 47 | int $offset, |
| 49 | 48 | ?int$length = null, |
| 50 | 49 | array $items = [] |