Skip to content

Commit e11f686

Browse files
committed
Apply PHP-CS-Fixer changes
1 parent 242330f commit e11f686

8 files changed

Lines changed: 13 additions & 39 deletions

File tree

Handler/EmbeddedShortcodeHandler.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Webfactory\ShortcodeBundle\Handler;
44

5+
use InvalidArgumentException;
56
use Psr\Log\LoggerInterface;
67
use Psr\Log\NullLogger;
78
use Symfony\Component\HttpFoundation\RequestStack;
@@ -32,11 +33,9 @@ class EmbeddedShortcodeHandler
3233
private $requestStack;
3334

3435
/**
35-
* @param FragmentHandler $fragmentHandler
3636
* @param string $controllerName
3737
* @param string $renderer
3838
* @param LoggerInterface $logger
39-
* @param RequestStack $requestStack
4039
*/
4140
public function __construct(
4241
FragmentHandler $fragmentHandler,
@@ -53,8 +52,6 @@ public function __construct(
5352
}
5453

5554
/**
56-
* @param ShortcodeInterface $shortcode
57-
*
5855
* @return string|null
5956
*/
6057
public function __invoke(ShortcodeInterface $shortcode)
@@ -78,21 +75,9 @@ public function __invoke(ShortcodeInterface $shortcode)
7875
),
7976
$this->renderer
8077
);
81-
} catch (\InvalidArgumentException $exception) {
78+
} catch (InvalidArgumentException $exception) {
8279
if ('esi' === $this->renderer) {
83-
throw new \InvalidArgumentException(
84-
'An InvalidArgumentException occured while trying to render the shortcode '
85-
.$shortcode->getShortcodeText().'. You\'ve probably tried to use the ESI rendering strategy for '
86-
.'your shortcodes while handling a request that contained non-scalar values as part of URI '
87-
.'attributes. This can happen e.g. when using Param Converters for your original controller '
88-
.'action, as the request (containing the conversion result) is automatically passed to the call of '
89-
.'the shortcode controller to allow context sensitive shortcodes. You could use '
90-
.'Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler.inline as parent in your '
91-
.'shortcode\'s service defintion, so that the inline instead of ESI rendering strategy will be '
92-
.'used.',
93-
0,
94-
$exception
95-
);
80+
throw new InvalidArgumentException('An InvalidArgumentException occured while trying to render the shortcode '.$shortcode->getShortcodeText().'. You\'ve probably tried to use the ESI rendering strategy for '.'your shortcodes while handling a request that contained non-scalar values as part of URI '.'attributes. This can happen e.g. when using Param Converters for your original controller '.'action, as the request (containing the conversion result) is automatically passed to the call of '.'the shortcode controller to allow context sensitive shortcodes. You could use '.'Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler.inline as parent in your '.'shortcode\'s service defintion, so that the inline instead of ESI rendering strategy will be '.'used.', 0, $exception);
9681
}
9782

9883
throw $exception;

Handler/RemoveWrappingParagraphElementsEventHandler.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
*/
1313
final class RemoveWrappingParagraphElementsEventHandler
1414
{
15-
/**
16-
* @param ReplaceShortcodesEvent $event
17-
*/
1815
public function __invoke(ReplaceShortcodesEvent $event)
1916
{
2017
/* The text still containing shortcodes */

Tests/DependencyInjection/Compiler/ShortcodeCompilerPassTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Webfactory\ShortcodeBundle\Tests\DependencyInjection\Compiler;
44

55
use PHPUnit\Framework\TestCase;
6+
use PHPUnit_Framework_MockObject_MockObject;
67
use Symfony\Component\DependencyInjection\ContainerBuilder;
78
use Symfony\Component\DependencyInjection\Definition;
89
use Symfony\Component\DependencyInjection\Reference;
@@ -19,7 +20,7 @@ final class ShortcodeCompilerPassTest extends TestCase
1920
*/
2021
private $compilerPass;
2122

22-
/** @var ContainerBuilder|\PHPUnit_Framework_MockObject_MockObject */
23+
/** @var ContainerBuilder|PHPUnit_Framework_MockObject_MockObject */
2324
private $containerBuilder;
2425

2526
protected function setUp(): void

Tests/Fixtures/TestKernel.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ public function getLogDir(): string
5353
*
5454
* $routes->import('config/routing.yml');
5555
* $routes->add('/admin', 'AppBundle:Admin:dashboard', 'admin_dashboard');
56-
*
57-
* @param RouteCollectionBuilder $routes
5856
*/
5957
protected function configureRoutes(RouteCollectionBuilder $routes): void
6058
{

Tests/Functional/ShortcodeFacadeTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Component\HttpFoundation\Request;
77
use Symfony\Component\HttpKernel\Controller\ControllerReference;
88
use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
9+
use Twig_Environment;
910

1011
final class ShortcodeFacadeTest extends KernelTestCase
1112
{
@@ -93,7 +94,7 @@ private function renderTwigTemplate(string $templateCode, array $context = []):
9394
/** @var $container ContainerInterface */
9495
$container = static::$kernel->getContainer();
9596

96-
/** @var \Twig_Environment $twig */
97+
/** @var Twig_Environment $twig */
9798
$twig = $container->get('twig');
9899
$template = $twig->createTemplate($templateCode);
99100

Tests/Functional/ShortcodeTest.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Webfactory\ShortcodeBundle\Tests\Functional;
44

5+
use PHPUnit_Framework_ExpectationFailedException;
6+
use PHPUnit_Framework_IncompleteTestError;
57
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
68
use Symfony\Component\BrowserKit\Client;
79
use Symfony\Component\DomCrawler\Crawler;
@@ -24,9 +26,7 @@ protected function setUp(): void
2426
parent::setUp();
2527

2628
if ('' === $this->getShortcodeToTest() || null === $this->getShortcodeToTest()) {
27-
throw new \PHPUnit_Framework_IncompleteTestError(
28-
'Albeit being a '.__CLASS__.', '.\get_called_class().' does not define a shortcode to test.'
29-
);
29+
throw new PHPUnit_Framework_IncompleteTestError('Albeit being a '.__CLASS__.', '.static::class.' does not define a shortcode to test.');
3030
}
3131

3232
static::bootKernel();
@@ -45,8 +45,6 @@ protected function getRenderedExampleHtml(?array $customParameters = null): stri
4545

4646
/**
4747
* @param array|string|null $customParameters use of strings is deprecated, use array instead.
48-
*
49-
* @return Crawler
5048
*/
5149
protected function crawlRenderedExample(/*array*/ $customParameters = null): Crawler
5250
{
@@ -57,19 +55,14 @@ protected function crawlRenderedExample(/*array*/ $customParameters = null): Cra
5755

5856
$crawlerOnRenderedExample = $crawlerOnRenderedExamplePage->filter('#rendered-example');
5957
if (0 === $crawlerOnRenderedExample->count()) {
60-
throw new \PHPUnit_Framework_ExpectationFailedException(
61-
'No rendered example found for shortcode "'.$this->shortcode.'"'
62-
);
58+
throw new PHPUnit_Framework_ExpectationFailedException('No rendered example found for shortcode "'.$this->shortcode.'"');
6359
}
6460

6561
return $crawlerOnRenderedExample;
6662
}
6763

6864
/**
69-
* @param int $expectedStatusCode
70-
* @param array|string|null $customParameters use of strings is deprecated, use array instead.
71-
*
72-
* @return Crawler
65+
* @param array|string|null $customParameters use of strings is deprecated, use array instead.
7366
*/
7467
protected function assertHttpStatusCodeWhenCrawlingRenderedExample(
7568
int $expectedStatusCode,

Twig/ShortcodeExtension.php

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

33
namespace Webfactory\ShortcodeBundle\Twig;
44

5-
use Thunder\Shortcode\EventContainer\EventContainer;
65
use Thunder\Shortcode\Processor\Processor;
76
use Twig\Extension\AbstractExtension;
87
use Twig\TwigFilter;

WebfactoryShortcodeBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Webfactory\ShortcodeBundle;
44

5-
use Symfony\Component\HttpKernel\Bundle\Bundle;
65
use Symfony\Component\DependencyInjection\ContainerBuilder;
6+
use Symfony\Component\HttpKernel\Bundle\Bundle;
77
use Webfactory\ShortcodeBundle\DependencyInjection\Compiler\ShortcodeCompilerPass;
88

99
/**

0 commit comments

Comments
 (0)