chore: run php-cs-fixer

This commit is contained in:
Younes ENNAJI
2024-09-19 06:42:10 +01:00
parent 51dd7dc6fb
commit d59e37812d
38 changed files with 221 additions and 85 deletions
@@ -55,7 +55,7 @@ final class FlasherContainerTest extends TestCase
$container->method('get')->willReturn($invalidService);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage(sprintf('Expected an instance of "%s" or "%s", got "%s".', FlasherInterface::class, NotificationFactoryInterface::class, get_debug_type($invalidService)));
$this->expectExceptionMessage(\sprintf('Expected an instance of "%s" or "%s", got "%s".', FlasherInterface::class, NotificationFactoryInterface::class, get_debug_type($invalidService)));
FlasherContainer::from($container);
FlasherContainer::create('invalid_service');
@@ -68,7 +68,7 @@ final class EventDispatcherTest extends TestCase
public function testDispatchWithNonCallableListener(): void
{
$event = new class() {};
$event = new class {};
$eventName = $event::class;
$listener = new NonCallableListener($eventName);
+1 -1
View File
@@ -149,7 +149,7 @@ final class ResponseExtensionTest extends TestCase
$responseExtension = new ResponseExtension($flasher, $cspHandler);
$responseExtension->render($request, $response);
$htmlInjection = HtmlPresenter::FLASHER_REPLACE_ME === $placeholder ? sprintf('options.push(%s);', $htmlResponse) : $htmlResponse;
$htmlInjection = HtmlPresenter::FLASHER_REPLACE_ME === $placeholder ? \sprintf('options.push(%s);', $htmlResponse) : $htmlResponse;
$expectedContent = str_replace($placeholder, "{$htmlInjection}\n{$placeholder}", $contentBefore);
$response->shouldHaveReceived('setContent')->with($expectedContent)->once();
@@ -70,7 +70,7 @@ final class FilterFactoryTest extends TestCase
$reflect = new \ReflectionClass(FilterFactory::class);
$reflectValue = $reflect->getProperty('criteria');
$this->filterFactory->addCriteria('custom_criteria', fn () => new class() implements CriteriaInterface {
$this->filterFactory->addCriteria('custom_criteria', fn () => new class implements CriteriaInterface {
public function apply(array $envelopes): array
{
return $envelopes;
@@ -11,11 +11,11 @@ final class ForwardsCallsTest extends TestCase
{
public function testSuccessfulMethodForwarding(): void
{
$testable = new class() {
$testable = new class {
use ForwardsCalls;
};
$secondary = new class() {
$secondary = new class {
public function someMethod(): string
{
return 'method result';
@@ -31,11 +31,11 @@ final class ForwardsCallsTest extends TestCase
public function testForwardingAndReturningThis(): void
{
$testable = new class() {
$testable = new class {
use ForwardsCalls;
};
$secondary = new class() {
$secondary = new class {
public function selfReturningMethod(): self
{
return $this;
@@ -52,11 +52,11 @@ final class ForwardsCallsTest extends TestCase
public function testUndefinedMethodCall(): void
{
$testable = new class() {
$testable = new class {
use ForwardsCalls;
};
$secondary = new class() {
$secondary = new class {
// This class intentionally left blank to simulate an undefined method call.
};
+5 -5
View File
@@ -11,7 +11,7 @@ final class MacroableTest extends TestCase
{
public function testMacroRegistrationAndExecution(): void
{
$macroableClass = new class() {
$macroableClass = new class {
use Macroable;
};
@@ -25,11 +25,11 @@ final class MacroableTest extends TestCase
public function testMixin(): void
{
$macroableClass = new class() {
$macroableClass = new class {
use Macroable;
};
$mixin = new class() {
$mixin = new class {
public function mixedInMethod(): callable
{
return static function () {
@@ -46,7 +46,7 @@ final class MacroableTest extends TestCase
public function testExceptionForNonExistingMacro(): void
{
$macroableClass = new class() {
$macroableClass = new class {
use Macroable;
};
@@ -56,7 +56,7 @@ final class MacroableTest extends TestCase
public function testExceptionForNonCallableMacro(): void
{
$macroableClass = new class() {
$macroableClass = new class {
use Macroable;
};