@@ -18,6 +18,7 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * @inheritDoc |
| 20 | 20 | * @param ArgumentResolverException $previous |
| 21 | + * @param string $entryId |
|
| 21 | 22 | */ |
| 22 | 23 | public function __construct($entryId, array $referenceChain, ArgumentResolverException $previous) |
| 23 | 24 | { |
@@ -48,8 +48,7 @@ discard block |
||
| 48 | 48 | private function formatFunction(ReflectionFunctionAbstract $function) |
| 49 | 49 | { |
| 50 | 50 | return $function instanceof ReflectionMethod ? |
| 51 | - $function->getDeclaringClass()->getName() . '::' . $function->getName() : |
|
| 52 | - $function->getName(); |
|
| 51 | + $function->getDeclaringClass()->getName() . '::' . $function->getName() : $function->getName(); |
|
| 53 | 52 | } |
| 54 | 53 | |
| 55 | 54 | /** |
@@ -61,7 +60,6 @@ discard block |
||
| 61 | 60 | private function formatParameter(ReflectionParameter $parameter): string |
| 62 | 61 | { |
| 63 | 62 | return $parameter->hasType() ? |
| 64 | - sprintf('%s $%s', $parameter->getType(), $parameter->getName()) : |
|
| 65 | - sprintf('$%s', $parameter->getName()); |
|
| 63 | + sprintf('%s $%s', $parameter->getType(), $parameter->getName()) : sprintf('$%s', $parameter->getName()); |
|
| 66 | 64 | } |
| 67 | 65 | } |
| 68 | 66 | \ No newline at end of file |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * Method that transforms Class to a plain text to include it in Response header |
| 55 | 55 | * |
| 56 | - * @return mixed |
|
| 56 | + * @return string |
|
| 57 | 57 | */ |
| 58 | 58 | public function asPlainText(); |
| 59 | 59 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | public function getName(); |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | - * @return string; |
|
| 76 | + * @return string|null |
|
| 77 | 77 | */ |
| 78 | 78 | public function getValue(); |
| 79 | 79 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | /** |
| 26 | 26 | * ErrorHandlerLogger constructor. |
| 27 | 27 | * |
| 28 | - * @param LoggerInterface $logger |
|
| 28 | + * @param \Psr\Log\LoggerInterface $logger |
|
| 29 | 29 | */ |
| 30 | 30 | public function __construct(LoggerInterface $logger) |
| 31 | 31 | { |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * @param \Swift_Events_EventObject $evt |
| 46 | - * @param $target |
|
| 46 | + * @param string $target |
|
| 47 | 47 | * @return string |
| 48 | 48 | */ |
| 49 | 49 | protected function normalizeEventName(Swift_Events_EventObject $evt, $target) |
@@ -223,7 +223,7 @@ |
||
| 223 | 223 | /** |
| 224 | 224 | * Returns proper transport closure factory |
| 225 | 225 | * |
| 226 | - * @param $transportName |
|
| 226 | + * @param string $transportName |
|
| 227 | 227 | * @return \Closure |
| 228 | 228 | */ |
| 229 | 229 | protected function getTransport($transportName) |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $spoolRealTransport = $this->getTransport($transport); |
| 154 | 154 | |
| 155 | 155 | $this->eventDispatcher->attach(self::SPOOL_SEND_EVENT, 'send.swiftmailer.spooled', |
| 156 | - function () use ($spoolRealTransport, $spool) { |
|
| 156 | + function() use ($spoolRealTransport, $spool) { |
|
| 157 | 157 | $failedRecipients = []; |
| 158 | 158 | $spool->getSpool()->flushQueue($spoolRealTransport(), $failedRecipients); |
| 159 | 159 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $eventDispatcherAdapter = $this->eventDispatcherAdapter; |
| 255 | 255 | switch ($transport) { |
| 256 | 256 | case('smtp'): |
| 257 | - $closure = function () use ($config) { |
|
| 257 | + $closure = function() use ($config) { |
|
| 258 | 258 | $transportInstance = new Swift_SmtpTransport( |
| 259 | 259 | $config->get('host'), |
| 260 | 260 | $config->get('port'), |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | }; |
| 285 | 285 | break; |
| 286 | 286 | case('mail'): |
| 287 | - $closure = function () use ($eventDispatcherAdapter) { |
|
| 287 | + $closure = function() use ($eventDispatcherAdapter) { |
|
| 288 | 288 | return new Swift_Transport_MailTransport( |
| 289 | 289 | new Swift_Transport_SimpleMailInvoker(), |
| 290 | 290 | $eventDispatcherAdapter |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | }; |
| 293 | 293 | break; |
| 294 | 294 | case('null'): |
| 295 | - $closure = function () use ($eventDispatcherAdapter) { |
|
| 295 | + $closure = function() use ($eventDispatcherAdapter) { |
|
| 296 | 296 | return new Swift_Transport_NullTransport($eventDispatcherAdapter); |
| 297 | 297 | }; |
| 298 | 298 | break; |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | /** |
| 79 | 79 | * Route constructor. |
| 80 | 80 | * |
| 81 | - * @param array $methods |
|
| 81 | + * @param string[] $methods |
|
| 82 | 82 | * @param string $path |
| 83 | 83 | * @param string $responder |
| 84 | 84 | */ |
@@ -321,8 +321,7 @@ |
||
| 321 | 321 | { |
| 322 | 322 | $route = clone $this; |
| 323 | 323 | $route->path = $prefix == '/' || $prefix == '' ? |
| 324 | - $route->path : |
|
| 325 | - sprintf('/%s/%s', trim($prefix, '/'), ltrim($route->path, '/')); |
|
| 324 | + $route->path : sprintf('/%s/%s', trim($prefix, '/'), ltrim($route->path, '/')); |
|
| 326 | 325 | |
| 327 | 326 | return $route; |
| 328 | 327 | } |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | public function __construct() |
| 95 | 95 | { |
| 96 | 96 | $this->setArgumentResolver(new ArgumentResolver($this)) |
| 97 | - ->setObjectInflector(new ObjectInflector($this->argumentResolver)); |
|
| 97 | + ->setObjectInflector(new ObjectInflector($this->argumentResolver)); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | if (!$this->isResolvableService($class)) { |
| 119 | 119 | throw new InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); |
| 120 | 120 | } |
| 121 | - $this->register($id, $shared, function ($id) use ($class) { |
|
| 121 | + $this->register($id, $shared, function($id) use ($class) { |
|
| 122 | 122 | $this->classDefinitions[$id] = $class; |
| 123 | 123 | }); |
| 124 | 124 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | throw new InvalidArgumentException('Invalid callable provided.'); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - $this->register($id, $shared, function ($id) use ($normalizedCallable) { |
|
| 136 | + $this->register($id, $shared, function($id) use ($normalizedCallable) { |
|
| 137 | 137 | $this->callableDefinitions[$id] = $normalizedCallable; |
| 138 | 138 | }); |
| 139 | 139 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | if (!$this->isConcrete($instance)) { |
| 147 | 147 | throw new InvalidArgumentException('Invalid instance provided.'); |
| 148 | 148 | } |
| 149 | - $this->register($id, true, function ($id) use ($instance) { |
|
| 149 | + $this->register($id, true, function($id) use ($instance) { |
|
| 150 | 150 | $this->instances[$id] = $instance; |
| 151 | 151 | }); |
| 152 | 152 | } |
@@ -317,13 +317,13 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | // Wrap with Closure to save reflection resolve results. |
| 320 | - return function (array $arguments = []) use ($object, $method, $resolve) { |
|
| 320 | + return function(array $arguments = []) use ($object, $method, $resolve) { |
|
| 321 | 321 | return ([$object, $method])(...$resolve($arguments)); |
| 322 | 322 | }; |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | // We have Closure or "functionName" string. |
| 326 | - return function (array $arguments = []) use ($callable, $resolve) { |
|
| 326 | + return function(array $arguments = []) use ($callable, $resolve) { |
|
| 327 | 327 | return $callable(...$resolve($arguments)); |
| 328 | 328 | }; |
| 329 | 329 | } |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | ? $this->argumentResolver->resolveArguments($constructor) |
| 347 | 347 | : null; |
| 348 | 348 | |
| 349 | - return function (array $arguments = []) use ($class, $resolve) { |
|
| 349 | + return function(array $arguments = []) use ($class, $resolve) { |
|
| 350 | 350 | $object = $resolve ? new $class(...$resolve($arguments)) : new $class(); |
| 351 | 351 | |
| 352 | 352 | return $object; |
@@ -177,6 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | /** |
| 179 | 179 | * @inheritDoc |
| 180 | + * @param string $id |
|
| 180 | 181 | */ |
| 181 | 182 | public function get($id, array $arguments = []) |
| 182 | 183 | { |
@@ -397,7 +398,7 @@ discard block |
||
| 397 | 398 | /** |
| 398 | 399 | * Verifies that provided callable can be called by service container. |
| 399 | 400 | * |
| 400 | - * @param $normalizedCallable |
|
| 401 | + * @param callable $normalizedCallable |
|
| 401 | 402 | * @return bool |
| 402 | 403 | */ |
| 403 | 404 | private function isResolvableCallable($normalizedCallable): bool |
@@ -50,13 +50,13 @@ |
||
| 50 | 50 | { |
| 51 | 51 | $parameters = $function->getParameters(); |
| 52 | 52 | |
| 53 | - return function (array $arguments = []) use ($function, $parameters) { |
|
| 53 | + return function(array $arguments = []) use ($function, $parameters) { |
|
| 54 | 54 | // Use passed arguments in place of reflected parameters. |
| 55 | 55 | $provided = array_intersect_key($arguments, $parameters); |
| 56 | 56 | |
| 57 | 57 | // Remaining parameters will be resolved by container. |
| 58 | 58 | $remaining = array_diff_key($parameters, $arguments); |
| 59 | - $resolved = array_map(function (ReflectionParameter $parameter) use ($function) { |
|
| 59 | + $resolved = array_map(function(ReflectionParameter $parameter) use ($function) { |
|
| 60 | 60 | |
| 61 | 61 | // Recursively resolve function arguments. |
| 62 | 62 | $class = $parameter->getClass(); |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | $arguments = $callback($inflection); |
| 68 | 68 | |
| 69 | 69 | // Wrap calling method with closure to avoid reflecting / resolving each time inflection applied. |
| 70 | - $this->inflections[$type][$method] = $inflection = function () use ($method, $arguments) { |
|
| 70 | + $this->inflections[$type][$method] = $inflection = function() use ($method, $arguments) { |
|
| 71 | 71 | $this->$method(...$arguments); |
| 72 | 72 | }; |
| 73 | 73 | } |