Skip to content

Commit

Permalink
Fix CS with PHP-CS-Fixer 2.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude authored and github-actions[bot] committed May 27, 2022
1 parent 034539a commit 3b6102c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/DependencyInjection/WebfactoryShortcodeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

Expand All @@ -29,7 +28,7 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter('webfactory_shortcode.max_iterations', $config['max_iterations']);

foreach ($config['shortcodes'] as $shortcodeName => $shortcodeDefinition) {
$definition = new ChildDefinition('Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler.' . $shortcodeDefinition['method']);
$definition = new ChildDefinition('Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler.'.$shortcodeDefinition['method']);
$definition->replaceArgument(1, $shortcodeDefinition['controller']);
$definition->addTag('webfactory.shortcode', ['shortcode' => $shortcodeName, 'description' => $shortcodeDefinition['description'], 'example' => $shortcodeDefinition['example']]);
$container->setDefinition('webfactory_shortcode.handler.'.$shortcodeName, $definition);
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Controller/ShortcodeTestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ class ShortcodeTestController
{
public function test(string $foo = null): Response
{
return new Response('test' . ($foo ? ' foo='.$foo : ''));
return new Response('test'.($foo ? ' foo='.$foo : ''));
}
}
10 changes: 6 additions & 4 deletions tests/Functional/EndToEndTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Webfactory\ShortcodeBundle\Tests\Functional;

use Generator;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
Expand Down Expand Up @@ -34,14 +35,14 @@ public function content_without_shortcodes_wont_be_changed(): void
* @test
* @dataProvider provideShortcodeNames
*/
public function expand_shortcode_in_Twig(string $shortcodeName): void
public function expand_shortcode_in__twig(string $shortcodeName): void
{
$result = $this->renderTwig('{{ content | shortcodes }}', ['content' => "[$shortcodeName foo=bar]"]);

self::assertSame('test foo=bar', $result);
}

public function provideShortcodeNames(): \Generator
public function provideShortcodeNames(): Generator
{
yield 'Inline shortcode defined in bundle config' => ['test-config-inline'];
yield 'ESI-based shortcode defined in bundle config' => ['test-config-esi'];
Expand All @@ -53,7 +54,7 @@ public function provideShortcodeNames(): \Generator
* @test
* @dataProvider provideEsiShortcodes
*/
public function uses_ESI_fragments(string $shortcodeName): void
public function uses__es_i_fragments(string $shortcodeName): void
{
$request = new Request([], [], [], [], [], ['SCRIPT_URL' => '/', 'HTTP_HOST' => 'localhost']);
$request->headers->set('Surrogate-Capability', 'ESI/1.0');
Expand All @@ -63,7 +64,7 @@ public function uses_ESI_fragments(string $shortcodeName): void
self::assertStringContainsString('<esi:include ', $result);
}

public function provideEsiShortcodes(): \Generator
public function provideEsiShortcodes(): Generator
{
yield 'ESI-based shortcode defined in bundle configuration' => ['test-config-esi'];
yield 'ESI-based shortcode defined in service configuration' => ['test-service-esi'];
Expand All @@ -81,6 +82,7 @@ private function renderTwig(string $templateCode, array $context = [], Request $
$twig = $container->get('twig');

$template = $twig->createTemplate($templateCode);

return $twig->render($template, $context);
}
}
3 changes: 1 addition & 2 deletions tests/Functional/ShortcodeGuideTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ShortcodeGuideTest extends WebTestCase
/**
* @test
*/
public function ShortcodeGuide_contains_test_entry(): void
public function shortcode_guide_contains_test_entry(): void
{
$client = static::createClient();
$crawler = $client->request('GET', '/');
Expand All @@ -21,4 +21,3 @@ public function ShortcodeGuide_contains_test_entry(): void
self::assertStringContainsString('test-shortcode-guide test=true', $text);
}
}

0 comments on commit 3b6102c

Please sign in to comment.