Skip to content

Commit b25d58e

Browse files
committed
Fix static analysis, tests and CS.
1 parent b85c41e commit b25d58e

13 files changed

Lines changed: 22 additions & 29 deletions

File tree

phpstan.tests.neon

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ parameters:
1010
- '#PHPUnit\\Framework\\MockObject\\MockObject given#'
1111
- '#PHPUnit\\Framework\\MockObject\\MockObject::expects()#'
1212
- '#Call to an undefined method Icings\\Menu\\Matcher\\Voter\\UrlVoter\|PHPUnit\\Framework\\MockObject\\MockObject::matchItem\(\)#'
13-
- '#Call to an undefined static method Icings\\Menu\\TestSuite\\RequestFactoryTrait\|PHPUnit\\Framework\\MockObject\\MockObject::createRequest\(\)#'
13+
- '#Call to static method createRequest\(\) on an unknown class Icings\\Menu\\TestSuite\\RequestFactoryTrait#'
1414
- '#Call to an undefined method Icings\\Menu\\View\\Helper\\MenuHelper\|PHPUnit\\Framework\\MockObject\\MockObject::setMenuFactory\(\)#'
1515
- '#Call to an undefined method Icings\\Menu\\View\\Helper\\MenuHelper\|PHPUnit\\Framework\\MockObject\\MockObject::create\(\)#'
1616
- '#Call to an undefined method Icings\\Menu\\View\\Helper\\MenuHelper\|PHPUnit\\Framework\\MockObject\\MockObject::render\(\)#'
1717
- '#Call to an undefined method Icings\\Menu\\View\\Helper\\MenuHelper\|PHPUnit\\Framework\\MockObject\\MockObject::setConfig\(\)#'
1818
- '#Class Icings\\Menu\\Renderer\\StringTemplateRenderer constructor invoked with 0 parameters, 1-2 required#'
1919
- '#Parameter \#1 \$matcher of class Icings\\Menu\\Renderer\\StringTemplateRenderer constructor expects Knp\\Menu\\Matcher\\MatcherInterface, string given#'
2020
- '#Parameter \#2 \$config of class Icings\\Menu\\Renderer\\StringTemplateRenderer constructor expects array, string given#'
21-
- '#Parameter \#1 \$name of method Icings\\Menu\\View\\Helper\\MenuHelper::create\(\) expects array|Knp\Menu\ItemInterface|string|null, int given#'
21+
- '#Parameter \#1 \$name of method Icings\\Menu\\View\\Helper\\MenuHelper::create\(\) expects string, int given#'
22+
- '#Parameter \#1 \$menu of method Icings\\Menu\\View\\Helper\\MenuHelper::render\(\) expects array\|Knp\\Menu\\ItemInterface\|string\|null, int given#'
2223
- '#PHPDoc tag @var for variable \$stub has invalid type Icings\\Menu\\TestSuite\\RequestFactoryTrait#'
24+
- '#Parameter \#1 \$input of function array_walk expects array, array\<int, string\>\|false given#'
25+
- '#Parameter \#1 \$input of function array_filter expects array, array\<int, string\>\|false given#'

src/Integration/PerItemVotersExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class PerItemVotersExtension implements ExtensionInterface
1919
{
2020
/**
21-
* {@inheritDoc}
21+
* @inheritDoc
2222
*/
2323
public function buildOptions(array $options = []): array
2424
{
@@ -31,7 +31,7 @@ public function buildOptions(array $options = []): array
3131
}
3232

3333
/**
34-
* {@inheritDoc}
34+
* @inheritDoc
3535
*/
3636
public function buildItem(ItemInterface $item, array $options): void
3737
{

src/Integration/RoutingExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class RoutingExtension implements ExtensionInterface
2020
{
2121
/**
22-
* {@inheritDoc}
22+
* @inheritDoc
2323
*/
2424
public function buildOptions(array $options = []): array
2525
{
@@ -55,7 +55,7 @@ public function buildOptions(array $options = []): array
5555
}
5656

5757
/**
58-
* {@inheritDoc}
58+
* @inheritDoc
5959
*/
6060
public function buildItem(ItemInterface $item, array $options): void
6161
{

src/Integration/TemplaterExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class TemplaterExtension implements ExtensionInterface
1919
{
2020
/**
21-
* {@inheritDoc}
21+
* @inheritDoc
2222
*/
2323
public function buildOptions(array $options = []): array
2424
{
@@ -89,7 +89,7 @@ public function buildOptions(array $options = []): array
8989
}
9090

9191
/**
92-
* {@inheritDoc}
92+
* @inheritDoc
9393
*/
9494
public function buildItem(ItemInterface $item, array $options): void
9595
{

src/Matcher/Matcher.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ public function __construct()
4343
}
4444

4545
/**
46-
* {@inheritDoc}
46+
* @inheritDoc
4747
*/
4848
public function addVoter(VoterInterface $voter): void
4949
{
5050
$this->_voters[] = $voter;
5151
}
5252

5353
/**
54-
* {@inheritDoc}
54+
* @inheritDoc
5555
*/
5656
public function isCurrent(ItemInterface $item): bool
5757
{
@@ -81,7 +81,7 @@ public function isCurrent(ItemInterface $item): bool
8181
}
8282

8383
/**
84-
* {@inheritDoc}
84+
* @inheritDoc
8585
*/
8686
public function isAncestor(ItemInterface $item, ?int $depth = null): bool
8787
{
@@ -108,7 +108,7 @@ public function isAncestor(ItemInterface $item, ?int $depth = null): bool
108108
}
109109

110110
/**
111-
* {@inheritDoc}
111+
* @inheritDoc
112112
*/
113113
public function clear(): void
114114
{

src/Matcher/Voter/FuzzyRouteVoter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(ServerRequest $request)
4747
}
4848

4949
/**
50-
* {@inheritDoc}
50+
* @inheritDoc
5151
*/
5252
public function matchItem(ItemInterface $item): ?bool
5353
{
@@ -160,7 +160,6 @@ function (&$value) {
160160
* - normalization as applied by `_normalizeParams()`
161161
*
162162
* @see _normalizeParams()
163-
*
164163
* @param array $route The route (URL array) to normalize.
165164
* @return void
166165
*/

src/Matcher/Voter/UrlVoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct(ServerRequest $request, array $options = [])
8787
}
8888

8989
/**
90-
* {@inheritDoc}
90+
* @inheritDoc
9191
*/
9292
public function matchItem(ItemInterface $item): ?bool
9393
{

src/Renderer/StringTemplateRenderer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ public function __construct(MatcherInterface $matcher, array $config = [])
157157
* This method supports all the options that the constructor supports.
158158
*
159159
* @see __construct()
160-
*
161160
* @param ItemInterface $item The menu to render.
162161
* @param array $options An array of options, see the "Options" section in the method
163162
* description.

src/View/Helper/MenuHelper.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ public function getMenuFactory(): MenuFactoryInterface
146146
* @see StringTemplateRenderer::__construct()
147147
* @see create()
148148
* @see render()
149-
*
150149
* @param View $View The View this helper is being attached to.
151150
* @param array $config An array of options, see the "Configuration options" section in the
152151
* method description.
@@ -181,9 +180,7 @@ public function __construct(View $View, array $config = [])
181180
* passed as options to the renderer.
182181
*
183182
* @see __construct()
184-
*
185183
* @throws \InvalidArgumentException In case the `$name` argument is not a string, or is empty.
186-
*
187184
* @param string $name The name of the menu. The name serves as an identifier for retrieving
188185
* and rendering specific menus.
189186
* @param array $options An array of options, see the "Options" section in the method
@@ -210,7 +207,6 @@ public function create(string $name, array $options = []): ItemInterface
210207
* This method supports all the options that the constructor supports.
211208
*
212209
* @see __construct()
213-
*
214210
* @throws \RuntimeException In case no menu object is passed, and no menu has been created via
215211
* the `create()` method yet.
216212
* @throws \InvalidArgumentException In case the menu with name given in the `$menu` argument
@@ -224,7 +220,6 @@ public function create(string $name, array $options = []): ItemInterface
224220
* @throws \InvalidArgumentException In case the `voters` option is not an array.
225221
* @throws \InvalidArgumentException In case the `renderer` option is not a
226222
* `Knp\Menu\Renderer\RendererInterface` implementation.
227-
*
228223
* @param ItemInterface|string|array|null $menu Either an `\Knp\Menu\ItemInterface` implementation,
229224
* the name of a menu created via `create()`, or an array of options to use instead of the
230225
* `$options` argument. If omitted or an array, the menu that was last created via `create()`

tests/TestCase/Matcher/Voter/FuzzyRouteVoterTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ public function paramsDataProvider(): array
149149

150150
/**
151151
* @dataProvider paramsDataProvider
152-
*
153152
* @param string $requestUri
154153
* @param array $expected
155154
*/
@@ -518,7 +517,6 @@ public function matchingDataProvider(): array
518517

519518
/**
520519
* @dataProvider matchingDataProvider
521-
*
522520
* @param array $url The URL array to test.
523521
* @param string $requestUri The request URI to test against.
524522
* @param bool|null $expected The matching result.

0 commit comments

Comments
 (0)