Skip to content

Commit 738bf1b

Browse files
HeahDudeIltar van der Berg
authored and
Iltar van der Berg
committed
cs fixes
1 parent 2881f50 commit 738bf1b

12 files changed

+23
-23
lines changed

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ CHANGELOG
44
3.1.0
55
-----
66
* deprecated passing objects as URI attributes to the ESI and SSI renderers
7-
* Added a `LegacyArgumentResolver` with `getArguments()` and the corresponding interface `ArgumentResolverInterface`
8-
* Deprecated `ControllerResolver::getArguments()`, which uses the `LegacyArgumentResolver` as BC layer by extending it
9-
* The `HttpKernel` now accepts an additional argument for an `ArgumentResolverInterface`
10-
* Added the `ArgumentResolver` which features an extension point to resolve arguments in a more dynamic way
7+
* added `Symfony\Component\HttpKernel\Controller\LegacyArgumentResolver`
8+
* deprecated `ControllerResolver::getArguments()`
9+
* made `ControllerResolver` extend the `LegacyArgumentResolver` for BC
10+
* added `Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface`
11+
* added `Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface` as argument to `HttpKernel`
12+
* added `Symfony\Component\HttpKernel\Controller\ArgumentResolver`
1113

1214
3.0.0
1315
-----

Controller/ArgumentResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactoryInterface;
1616

1717
/**
18-
* Responsible for the resolving of arguments passed to an action.
18+
* Responsible for resolving the arguments passed to an action.
1919
*
2020
* @author Iltar van der Berg <kjarli@gmail.com>
2121
*/

Controller/ArgumentResolverInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\HttpFoundation\Request;
1515

1616
/**
17-
* An ArgumentResolverInterface implementation knows how to determine the
17+
* An ArgumentResolverInterface instance knows how to determine the
1818
* arguments for a specific action.
1919
*
2020
* @author Fabien Potencier <fabien@symfony.com>
@@ -29,7 +29,7 @@ interface ArgumentResolverInterface
2929
*
3030
* @return array An array of arguments to pass to the controller
3131
*
32-
* @throws \RuntimeException When value for argument given is not provided
32+
* @throws \RuntimeException When no value could be provided for a required argument
3333
*/
3434
public function getArguments(Request $request, $controller);
3535
}

Controller/ArgumentValueResolver/ArgumentFromAttributeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
1717

1818
/**
19-
* Grabs a non-variadic value from the request and returns it.
19+
* Yields a non-variadic argument's value from the request attributes.
2020
*
2121
* @author Iltar van der Berg <kjarli@gmail.com>
2222
*/

Controller/ArgumentValueResolver/DefaultArgumentValueResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
1717

1818
/**
19-
* Returns the default value defined in the action signature if present and no value has been given.
19+
* Yields the default value defined in the action signature when no value has been given.
2020
*
2121
* @author Iltar van der Berg <kjarli@gmail.com>
2222
*/

Controller/ArgumentValueResolver/RequestResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
1717

1818
/**
19-
* Supports the same instance as the request object passed along.
19+
* Yields the same instance as the request object passed along.
2020
*
2121
* @author Iltar van der Berg <kjarli@gmail.com>
2222
*/
@@ -27,7 +27,7 @@ final class RequestResolver implements ArgumentValueResolverInterface
2727
*/
2828
public function supports(Request $request, ArgumentMetadata $argument)
2929
{
30-
return $argument->getType() === Request::class || is_subclass_of($request, $argument->getType());
30+
return $argument->getType() === Request::class || is_subclass_of(Request::class, $argument->getType());
3131
}
3232

3333
/**

Controller/ArgumentValueResolver/VariadicArgumentValueResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
1717

1818
/**
19-
* Grabs the variadic value from the request and returns it.
19+
* Yields a variadic argument's values from the request attributes.
2020
*
2121
* @author Iltar van der Berg <kjarli@gmail.com>
2222
*/

Controller/ArgumentValueResolverInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
interface ArgumentValueResolverInterface
2323
{
2424
/**
25-
* Whether this resolver can resolve can resolve the value for the given ArgumentMetadata.
25+
* Whether this resolver can resolve the value for the given ArgumentMetadata.
2626
*
2727
* @param Request $request
2828
* @param ArgumentMetadata $argument
@@ -34,8 +34,6 @@ public function supports(Request $request, ArgumentMetadata $argument);
3434
/**
3535
* Yield the possible value(s).
3636
*
37-
* An implementation must yield at least one value.
38-
*
3937
* @param Request $request
4038
* @param ArgumentMetadata $argument
4139
*

Controller/ControllerResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getController(Request $request)
8585
/**
8686
* {@inheritdoc}
8787
*
88-
* @deprecated this method is deprecated as of 3.1 and will be removed in 4.0. Implement the ArgumentResolverInterface or extend the LegacyArgumentResolver instead.
88+
* @deprecated This method is deprecated as of 3.1 and will be removed in 4.0. Implement the ArgumentResolverInterface or extend the LegacyArgumentResolver instead.
8989
*/
9090
public function getArguments(Request $request, $controller)
9191
{
@@ -95,7 +95,7 @@ public function getArguments(Request $request, $controller)
9595
}
9696

9797
/**
98-
* @deprecated this method is deprecated as of 3.1 and will be removed in 4.0. Implement the ArgumentResolverInterface or extend the LegacyArgumentResolver instead.
98+
* @deprecated This method is deprecated as of 3.1 and will be removed in 4.0. Implement the ArgumentResolverInterface or extend the LegacyArgumentResolver instead.
9999
*/
100100
protected function doGetArguments(Request $request, $controller, array $parameters)
101101
{

Controller/LegacyArgumentResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class LegacyArgumentResolver implements ArgumentResolverInterface
2727
*/
2828
public function getArguments(Request $request, $controller)
2929
{
30-
// only trigger the deprecation notice if actually used, the ControllerResolver still extends this for BC reasons
30+
// only trigger the deprecation notice if actually used, the ControllerResolver still extends it for BC
3131
@trigger_error(sprintf('The %s class is deprecated since 3.1 and will be removed in 4.0. Please use the %s instead.', __CLASS__, ArgumentResolver::class), E_USER_DEPRECATED);
3232

3333
if (is_array($controller)) {

Controller/TraceableControllerResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(ControllerResolverInterface $resolver, Stopwatch $st
3838
$this->stopwatch = $stopwatch;
3939
$this->argumentResolver = $argumentResolver;
4040

41-
// required for BC reasons
41+
// BC
4242
if (null === $this->argumentResolver) {
4343
$this->argumentResolver = $resolver;
4444
}

ControllerMetadata/ArgumentMetadataFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function createArgumentMetadata($controller)
3434
}
3535

3636
foreach ($reflection->getParameters() as $param) {
37-
$arguments[] = new ArgumentMetadata($param->getName(), $this->getType($param), $this->isVariadic($param), $this->hasDefaulValue($param), $this->getDefaulValue($param));
37+
$arguments[] = new ArgumentMetadata($param->getName(), $this->getType($param), $this->isVariadic($param), $this->hasDefaultValue($param), $this->getDefaultValue($param));
3838
}
3939

4040
return $arguments;
@@ -59,7 +59,7 @@ private function isVariadic(\ReflectionParameter $parameter)
5959
*
6060
* @return bool
6161
*/
62-
private function hasDefaulValue(\ReflectionParameter $parameter)
62+
private function hasDefaultValue(\ReflectionParameter $parameter)
6363
{
6464
return $parameter->isDefaultValueAvailable();
6565
}
@@ -71,9 +71,9 @@ private function hasDefaulValue(\ReflectionParameter $parameter)
7171
*
7272
* @return mixed|null
7373
*/
74-
private function getDefaulValue(\ReflectionParameter $parameter)
74+
private function getDefaultValue(\ReflectionParameter $parameter)
7575
{
76-
return $this->hasDefaulValue($parameter) ? $parameter->getDefaultValue() : null;
76+
return $this->hasDefaultValue($parameter) ? $parameter->getDefaultValue() : null;
7777
}
7878

7979
/**

0 commit comments

Comments
 (0)