@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * Helper method to get input argument |
37 | 37 | * |
38 | 38 | * @param string $name |
39 | - * @return mixed |
|
39 | + * @return string |
|
40 | 40 | */ |
41 | 41 | public function arg(string $name) |
42 | 42 | { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * Helper method to get input option |
84 | 84 | * |
85 | 85 | * @param string $name |
86 | - * @return mixed |
|
86 | + * @return string |
|
87 | 87 | */ |
88 | 88 | public function opt(string $name) |
89 | 89 | { |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * Returns command arguments array |
95 | 95 | * Values must be instances of InputArgument |
96 | 96 | * |
97 | - * @return array|InputArgument[] |
|
97 | + * @return \Symfony\Component\Console\Input\InputArgument[] |
|
98 | 98 | */ |
99 | 99 | public function returnArguments(): array |
100 | 100 | { |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * Returns command options array |
106 | 106 | * Values must be instances of InputOption |
107 | 107 | * |
108 | - * @return array|InputOption[] |
|
108 | + * @return \Symfony\Component\Console\Input\InputOption[] |
|
109 | 109 | */ |
110 | 110 | public function returnOptions(): array |
111 | 111 | { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Venta\Container\ArgumentResolver; |
6 | 6 | use PhpSpec\ObjectBehavior; |
7 | -use Prophecy\Argument; |
|
8 | 7 | use Venta\Contracts\Container\ArgumentResolver as ArgumentResolverContract; |
9 | 8 | use Venta\Contracts\Container\Container; |
10 | 9 |
@@ -397,7 +397,7 @@ |
||
397 | 397 | /** |
398 | 398 | * Verifies that provided callable can be called by service container. |
399 | 399 | * |
400 | - * @param $normalizedCallable |
|
400 | + * @param callable $normalizedCallable |
|
401 | 401 | * @return bool |
402 | 402 | */ |
403 | 403 | private function isResolvableCallable($normalizedCallable): bool |
@@ -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; |
@@ -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 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | /** |
40 | 40 | * RouteMatch constructor. |
41 | 41 | * |
42 | - * @param RouteCollector $collector |
|
42 | + * @param \Mockery\MockInterface $collector |
|
43 | 43 | * @param \Venta\Contracts\Routing\RouteMatcher $matcher |
44 | 44 | * @param RequestFactory $requestFactory |
45 | 45 | */ |
@@ -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 | { |
@@ -46,7 +46,7 @@ |
||
46 | 46 | /** |
47 | 47 | * Adding error handling middleware |
48 | 48 | * |
49 | - * @param \Venta\Contracts\Routing\MiddlewareCollector $middlewareCollector |
|
49 | + * @param \Mockery\MockInterface $middlewareCollector |
|
50 | 50 | * @return void |
51 | 51 | */ |
52 | 52 | public function provideMiddlewares(MiddlewareCollector $middlewareCollector) |
@@ -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()) { |
@@ -82,6 +82,10 @@ |
||
82 | 82 | $kernel = new class($container, __DIR__, 'providers.php') extends \Venta\Framework\Kernel\AbstractKernel |
83 | 83 | { |
84 | 84 | |
85 | + /** |
|
86 | + * @param string $name |
|
87 | + * @param Mockery\MockInterface $instance |
|
88 | + */ |
|
85 | 89 | public function addExtensionProviderInstance($name, $instance) |
86 | 90 | { |
87 | 91 | $this->extensions[$name] = $instance; |
@@ -42,17 +42,17 @@ |
||
42 | 42 | $container->shouldReceive('share')->with(Container::class, $container, ['container'])->passthru(); |
43 | 43 | $container->shouldReceive('share')->with(Kernel::class, Mockery::type(Kernel::class), ['kernel']); |
44 | 44 | $container->shouldReceive('share') |
45 | - ->with(RouteCollectorContract::class, Mockery::type(Closure::class)) |
|
46 | - ->passthru(); |
|
45 | + ->with(RouteCollectorContract::class, Mockery::type(Closure::class)) |
|
46 | + ->passthru(); |
|
47 | 47 | $container->shouldReceive('share') |
48 | - ->with(MiddlewareCollectorContract::class, Mockery::type(Closure::class)) |
|
49 | - ->passthru(); |
|
48 | + ->with(MiddlewareCollectorContract::class, Mockery::type(Closure::class)) |
|
49 | + ->passthru(); |
|
50 | 50 | $container->shouldReceive('share') |
51 | - ->with(CommandCollectorContract::class, Mockery::type(Closure::class)) |
|
52 | - ->passthru(); |
|
51 | + ->with(CommandCollectorContract::class, Mockery::type(Closure::class)) |
|
52 | + ->passthru(); |
|
53 | 53 | $container->shouldReceive('share') |
54 | - ->with(ConfigContract::class, Mockery::type(Closure::class), ['config']) |
|
55 | - ->passthru(); |
|
54 | + ->with(ConfigContract::class, Mockery::type(Closure::class), ['config']) |
|
55 | + ->passthru(); |
|
56 | 56 | |
57 | 57 | $routeCollector = Mockery::mock(RouteGroup::class); |
58 | 58 | $routeCollector->shouldReceive('group')->with('/', Mockery::type('callable'))->twice(); |
@@ -105,7 +105,7 @@ |
||
105 | 105 | { |
106 | 106 | $container = Mockery::mock(Container::class); |
107 | 107 | $container->shouldReceive('share')->with(Container::class, $container, ['container'])->once(); |
108 | - $container->shouldReceive('share')->with(Kernel::class, Mockery::on(function ($arg) { |
|
108 | + $container->shouldReceive('share')->with(Kernel::class, Mockery::on(function($arg) { |
|
109 | 109 | return $arg instanceof Kernel; |
110 | 110 | }), ['kernel'])->once(); |
111 | 111 |