Skip to content

Commit

Permalink
bot: fix cs [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Oct 8, 2024
1 parent 23512eb commit 66f22d4
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions tests/Command/ScheduleListCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function no_tasks_defined()
public function lists_configured_tasks_and_issues()
{
$runner = (new MockScheduleBuilder())
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->emailOnFailure('[email protected]');
Expand Down Expand Up @@ -92,7 +92,7 @@ public function buildSchedule(Schedule $schedule): void
public function renders_exception_stack_trace_if_verbose()
{
$runner = (new MockScheduleBuilder())
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->addCommand('my:command')
Expand Down Expand Up @@ -129,7 +129,7 @@ public function buildSchedule(Schedule $schedule): void
public function lists_configured_tasks_and_issues_in_detail()
{
$runner = (new MockScheduleBuilder())
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->emailOnFailure('[email protected]');
Expand Down Expand Up @@ -186,7 +186,7 @@ public function command_task_with_invalid_argument_shows_as_error()
;

$application = new Application();
$application->add(new class() extends Command {
$application->add(new class extends Command {
public static function getDefaultName(): string
{
return 'my:command';
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/ScheduleRunCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function skipped_schedule()
$dispatcher = new EventDispatcher();
$runner = (new MockScheduleBuilder())
->addTask(MockTask::success('my task 1'))
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->skip('This schedule was skipped.', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class ScheduleBuilderKernelPassTest extends AbstractCompilerPassTestCase
*/
public function adds_tag_if_kernel_implement_interface()
{
$class = new class() implements ScheduleBuilder {
$class = new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
}
Expand All @@ -46,7 +46,7 @@ public function buildSchedule(Schedule $schedule): void
*/
public function does_not_add_tag_if_kernel_does_not_implement_interface()
{
$class = new class() {
$class = new class {
};

$this->setDefinition('kernel', new Definition($class::class));
Expand Down
2 changes: 1 addition & 1 deletion tests/EventListener/ScheduleExtensionSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class ScheduleExtensionSubscriberTest extends TestCase
*/
public function can_configure_schedule_with_subscriber()
{
$extension = new class() {
$extension = new class {
};

$schedule = (new MockScheduleBuilder())
Expand Down
10 changes: 5 additions & 5 deletions tests/Schedule/Extension/EmailExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function sends_schedule_failure_email()

(new MockScheduleBuilder())
->addHandler(new EmailHandler($mailer, '[email protected]', '[email protected]'))
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->emailOnFailure();
Expand Down Expand Up @@ -71,7 +71,7 @@ public function sends_schedule_failure_email_with_overrides()

(new MockScheduleBuilder())
->addHandler(new EmailHandler($mailer, '[email protected]', '[email protected]'))
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->emailOnFailure('[email protected]', 'my subject', function(Email $email) {
Expand Down Expand Up @@ -99,7 +99,7 @@ public function sends_schedule_failure_email_with_configured_subject_prefix()

(new MockScheduleBuilder())
->addHandler(new EmailHandler($mailer, '[email protected]', '[email protected]', '[Acme Inc]'))
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->emailOnFailure();
Expand Down Expand Up @@ -247,7 +247,7 @@ public function provides_helpful_message_if_handler_not_configured()
$this->expectExceptionMessage('To use the email extension you must configure a mailer (config path: "zenstruck_schedule.mailer").');

(new MockScheduleBuilder())
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->emailOnFailure();
Expand Down Expand Up @@ -290,7 +290,7 @@ public function email_shows_if_task_was_force_run()

private function createMailer(): MailerInterface
{
return new class() implements MailerInterface {
return new class implements MailerInterface {
/** @var RawMessage */
public $lastMessage;

Expand Down
10 changes: 5 additions & 5 deletions tests/Schedule/Extension/NotifierExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function sends_schedule_failure_notification()

(new MockScheduleBuilder())
->addHandler(new NotifierHandler($notifier, ['chat/slack'], '[email protected]', '123456789'))
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->notifyOnFailure();
Expand Down Expand Up @@ -72,7 +72,7 @@ public function sends_schedule_failure_notification_with_overrides()

(new MockScheduleBuilder())
->addHandler(new NotifierHandler($notifier, ['chat/slack'], '[email protected]', '127.0.0.1'))
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->notifyOnFailure('teams', null, null, 'my subject', function(Notification $notification) {
Expand Down Expand Up @@ -100,7 +100,7 @@ public function sends_schedule_failure_notification_with_configured_subject_pref

(new MockScheduleBuilder())
->addHandler(new NotifierHandler($notifier, ['chat/slack'], '[email protected]', '[email protected]', '[Acme Inc]'))
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->notifyOnFailure();
Expand Down Expand Up @@ -251,7 +251,7 @@ public function provides_helpful_message_if_handler_not_configured()
$this->expectExceptionMessage('To use the notifier extension you must configure a notifier (config path: "zenstruck_schedule.notifier").');

(new MockScheduleBuilder())
->addBuilder(new class() implements ScheduleBuilder {
->addBuilder(new class implements ScheduleBuilder {
public function buildSchedule(Schedule $schedule): void
{
$schedule->notifyOnFailure();
Expand Down Expand Up @@ -294,7 +294,7 @@ public function notification_shows_if_task_was_force_run()

private function createNotifier(): NotifierInterface
{
return new class() implements NotifierInterface {
return new class implements NotifierInterface {
/** @var Notification */
public $lastNotification;

Expand Down
4 changes: 2 additions & 2 deletions tests/Schedule/SelfSchedulingCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class SelfSchedulingCommandTest extends TestCase
*/
public function commands_can_self_schedule()
{
$command = new class() extends Command implements SelfSchedulingCommand {
$command = new class extends Command implements SelfSchedulingCommand {
public static function getDefaultName(): string
{
return 'my:command';
Expand All @@ -55,7 +55,7 @@ public function schedule(CommandTask $task): void
*/
public function throws_exception_if_not_a_command()
{
$command = new class() implements SelfSchedulingCommand {
$command = new class implements SelfSchedulingCommand {
public function schedule(CommandTask $task): void
{
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Schedule/Task/Runner/CallbackTaskRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function stringifies_output($output, $expectedOutput)

public static function outputProvider()
{
$stringClass = new class() {
$stringClass = new class {
public function __toString(): string
{
return 'as string';
Expand Down
2 changes: 1 addition & 1 deletion tests/Schedule/Task/Runner/CommandTaskRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function supports_command_task()

private function createCommand(): Command
{
return new class() extends Command {
return new class extends Command {
public static function getDefaultName(): string
{
return 'my:command';
Expand Down

0 comments on commit 66f22d4

Please sign in to comment.