Skip to content

Commit 71d4f5c

Browse files
committed
Use current php-cs-fixer rules
1 parent 639f2a9 commit 71d4f5c

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

.php_cs.dist

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
<?php
22

33
return PhpCsFixer\Config::create()
4-
->setRules(array(
4+
->setRules([
55
'@Symfony' => true,
66
'@Symfony:risky' => true,
7-
// 'array_syntax' => array('syntax' => 'long'),
7+
'array_syntax' => array('syntax' => 'short'),
88
'no_unreachable_default_argument_value' => false,
99
'braces' => array('allow_single_line_closure' => true),
1010
'heredoc_to_nowdoc' => false,
1111
'phpdoc_annotation_without_dot' => false,
12-
))
12+
])
1313
->setRiskyAllowed(true)
1414
->setFinder(
1515
PhpCsFixer\Finder::create()
1616
->in(__DIR__)
17-
->notPath('Tests/Fixtures/cache/')
17+
->notPath('conf/')
18+
->notPath('tmp/')
19+
->notPath('node_modules/')
20+
->notPath('var/cache')
1821
->notPath('vendor/')
1922
)
2023
;

Handler/EmbeddedShortcodeHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ class EmbeddedShortcodeHandler
3333

3434
/**
3535
* @param FragmentHandler $fragmentHandler
36-
* @param string $controllerName
37-
* @param string $renderer
36+
* @param string $controllerName
37+
* @param string $renderer
3838
* @param LoggerInterface $logger
39-
* @param RequestStack $requestStack
39+
* @param RequestStack $requestStack
4040
*/
4141
public function __construct(
4242
FragmentHandler $fragmentHandler,
@@ -79,7 +79,7 @@ public function __invoke(ShortcodeInterface $shortcode)
7979
$this->renderer
8080
);
8181
} catch (\InvalidArgumentException $exception) {
82-
if ($this->renderer === 'esi') {
82+
if ('esi' === $this->renderer) {
8383
throw new \InvalidArgumentException(
8484
'An InvalidArgumentException occured while trying to render the shortcode '
8585
.$shortcode->getShortcodeText().'. You\'ve probably tried to use the ESI rendering strategy for '

Tests/Functional/ShortcodeFacadeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
66
use Symfony\Component\HttpFoundation\Request;
7-
use Symfony\Component\HttpFoundation\Response;
87
use Symfony\Component\HttpKernel\Controller\ControllerReference;
98
use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
109

Tests/Functional/ShortcodeTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ protected function setUp(): void
3535

3636
/**
3737
* @param array|string|null $customParameters use of strings is deprecated, use array instead.
38+
*
3839
* @return Crawler
3940
*/
4041
protected function getRenderedExampleHtml(?array $customParameters = null): string
@@ -44,6 +45,7 @@ protected function getRenderedExampleHtml(?array $customParameters = null): stri
4445

4546
/**
4647
* @param array|string|null $customParameters use of strings is deprecated, use array instead.
48+
*
4749
* @return Crawler
4850
*/
4951
protected function crawlRenderedExample(/*array*/ $customParameters = null): Crawler
@@ -64,8 +66,9 @@ protected function crawlRenderedExample(/*array*/ $customParameters = null): Cra
6466
}
6567

6668
/**
67-
* @param int $expectedStatusCode
68-
* @param array|string|null $customParameters use of strings is deprecated, use array instead.
69+
* @param int $expectedStatusCode
70+
* @param array|string|null $customParameters use of strings is deprecated, use array instead.
71+
*
6972
* @return Crawler
7073
*/
7174
protected function assertHttpStatusCodeWhenCrawlingRenderedExample(
@@ -80,6 +83,7 @@ protected function assertHttpStatusCodeWhenCrawlingRenderedExample(
8083

8184
/**
8285
* @param array|string|null $customParameters use of strings is deprecated, use array instead.
86+
*
8387
* @return Crawler
8488
*/
8589
private function getUrlWithRenderedExample(/*array*/ $customParameters = null): string
@@ -96,14 +100,14 @@ private function getUrlWithRenderedExample(/*array*/ $customParameters = null):
96100

97101
private function getCustomParametersAsString($customParametersAsMixed): ?string
98102
{
99-
if (is_string($customParametersAsMixed)) {
103+
if (\is_string($customParametersAsMixed)) {
100104
return $customParametersAsMixed;
101105
}
102106

103-
if (is_array($customParametersAsMixed)) {
107+
if (\is_array($customParametersAsMixed)) {
104108
$customParametersAsString = '';
105109
foreach ($customParametersAsMixed as $name => $value) {
106-
$customParametersAsString .= $name .'='.$value.' ';
110+
$customParametersAsString .= $name.'='.$value.' ';
107111
}
108112

109113
return $customParametersAsString;

0 commit comments

Comments
 (0)