@@ -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 | } |
@@ -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; |
@@ -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; |
@@ -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 | } |
@@ -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 |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $this->container->bindClass(RoutePathParserContract::class, RoutePathParser::class, true); |
| 60 | 60 | $this->container->bindClass(FastRouteRouteParser::class, RoutePathParserContract::class); |
| 61 | 61 | |
| 62 | - $this->container->bindFactory(RouteCollector::class, function (FastRouteRouteParser $routePathParser) { |
|
| 62 | + $this->container->bindFactory(RouteCollector::class, function(FastRouteRouteParser $routePathParser) { |
|
| 63 | 63 | return new RouteCollector($routePathParser, new GroupCountBased); |
| 64 | 64 | }, true); |
| 65 | 65 | } |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | public function boot() |
| 26 | 26 | { |
| 27 | 27 | // todo: refactor along with console package. |
| 28 | - $this->container->bindFactory(InputInterface::class, function () { |
|
| 28 | + $this->container->bindFactory(InputInterface::class, function() { |
|
| 29 | 29 | return new ArgvInput; |
| 30 | 30 | }, true); |
| 31 | 31 | |
| 32 | - $this->container->bindFactory(OutputInterface::class, function () { |
|
| 32 | + $this->container->bindFactory(OutputInterface::class, function() { |
|
| 33 | 33 | return new ConsoleOutput; |
| 34 | 34 | }, true); |
| 35 | 35 | |
@@ -82,8 +82,7 @@ discard block |
||
| 82 | 82 | // Push pretty page handler only for local environment |
| 83 | 83 | $whoops->pushHandler( |
| 84 | 84 | $kernel->getEnvironment() === 'local' ? |
| 85 | - new PrettyPageHandler() : |
|
| 86 | - new PlainTextHandler() |
|
| 85 | + new PrettyPageHandler() : new PlainTextHandler() |
|
| 87 | 86 | ); |
| 88 | 87 | } |
| 89 | 88 | /** |
@@ -94,10 +93,10 @@ discard block |
||
| 94 | 93 | /* |
| 95 | 94 | * Bind PSR-3 logger |
| 96 | 95 | */ |
| 97 | - $container->share(\Monolog\Logger::class, function (Container $c) { |
|
| 96 | + $container->share(\Monolog\Logger::class, function(Container $c) { |
|
| 98 | 97 | $logger = new \Monolog\Logger('venta'); |
| 99 | 98 | $handler = new \Monolog\Handler\StreamHandler(__DIR__ . '/../storage/logs/app.log'); |
| 100 | - $handler->pushProcessor(function ($record) use ($c) { |
|
| 99 | + $handler->pushProcessor(function($record) use ($c) { |
|
| 101 | 100 | /** @var \Venta\Contracts\Kernel\Kernel $kernel */ |
| 102 | 101 | $kernel = $c->get(Kernel::class); |
| 103 | 102 | if ($kernel->isCli()) { |