Skip to content

Commit

Permalink
Fix CS with PHP-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianSchmick authored and github-actions[bot] committed Oct 14, 2024
1 parent ec8462b commit 277bddc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Handler/EmbeddedShortcodeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Webfactory\ShortcodeBundle\Handler;

use InvalidArgumentException;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Component\HttpFoundation\RequestStack;
Expand Down Expand Up @@ -38,11 +39,11 @@ public function __construct(
string $controllerName,
string $renderer,
RequestStack $requestStack,
LoggerInterface $logger = null
?LoggerInterface $logger = null
) {
$callableFragments = explode('::', $controllerName);
if (!is_array($callableFragments) || !isset($callableFragments[1]) || !method_exists($callableFragments[0], $callableFragments[1])) {
throw new \InvalidArgumentException('The controller method: "'.$controllerName.'" does not exist.');
if (!\is_array($callableFragments) || !isset($callableFragments[1]) || !method_exists($callableFragments[0], $callableFragments[1])) {
throw new InvalidArgumentException('The controller method: "'.$controllerName.'" does not exist.');
}

$this->fragmentHandler = $fragmentHandler;
Expand Down
5 changes: 3 additions & 2 deletions tests/Functional/EmbeddedShortcodeHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Webfactory\ShortcodeBundle\Tests\Functional;

use Generator;
use InvalidArgumentException;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
Expand Down Expand Up @@ -89,7 +90,7 @@ public function validate_valid_controller_names(): void
*/
public function validate_invalid_controller_names(string $controllerName): void
{
$this->expectException(\InvalidArgumentException::class);
$this->expectException(InvalidArgumentException::class);

new EmbeddedShortcodeHandler($this->createMock(FragmentHandler::class), $controllerName, 'inline', $this->createMock(RequestStack::class));
}
Expand All @@ -102,7 +103,7 @@ public function provideControllerNames(): Generator
yield 'Not existing method' => [GuideController::class.'_notExistingMethod'];
}

private function processShortcodes(string $content, Request $request = null): string
private function processShortcodes(string $content, ?Request $request = null): string
{
self::bootKernel();

Expand Down

0 comments on commit 277bddc

Please sign in to comment.