Skip to content

Symfony 7.3 beta incompatibility#61

Merged
mac-cain13 merged 3 commits intomac-cain13:masterfrom
umpirsky:handleSignal-7.3
Jun 2, 2025
Merged

Symfony 7.3 beta incompatibility#61
mac-cain13 merged 3 commits intomac-cain13:masterfrom
umpirsky:handleSignal-7.3

Conversation

@umpirsky
Copy link
Contributor

Fixes issue #60

@pieterocp
Copy link
Contributor

Yeah, but then it'll probably hit the next error message if one runs this. E.g. see below.

Try getting the tests passing locally and then crack on with the next bit.

/srv # bin/console example-command
TypeError {#284
  #message: "Symfony\Component\Console\Command\InvokableCommand::__construct(): Argument #2 ($code) must be of type callable, array given, called in /srv/vendor/symfony/console/Command/Command.php on line 350"
  #code: 0
  #file: "./vendor/symfony/console/Command/InvokableCommand.php"
  #line: 38
  trace: {
    ./vendor/symfony/console/Command/InvokableCommand.php:38 { …}
    ./vendor/symfony/console/Command/Command.php:350 { …}
    ./vendor/wrep/daemonizable-command/src/Wrep/Daemonizable/Command/EndlessCommand.php:51 { …}
    ./src/Command/EndlessCommand.php:19 {
      App\Command\EndlessCommand->__construct(EntityManagerInterface $entityManager, LoggerInterface $logger)^
      › {
      ›     parent::__construct();
      › }
    }
    ./src/Command/EventsProcessPendingCommand.php:46 { …}
    ./var/cache/dev/ContainerLT8LDPz/getEventsProcessPendingCommandService.php:32 { …}
    ./var/cache/dev/ContainerLT8LDPz/App_KernelDevDebugContainer.php:350 { …}
    ./var/cache/dev/ContainerLT8LDPz/getEventsProcessPendingCommand_LazyService.php:25 { …}
    ./vendor/symfony/console/Command/LazyCommand.php:189 { …}
    ./vendor/symfony/console/Application.php:337 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:77 { …}
    ./vendor/symfony/console/Application.php:192 { …}
    ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49 { …}
    ./vendor/autoload_runtime.php:29 { …}
    ./bin/console:15 { …}
  }
}

umpirsky added 2 commits May 30, 2025 14:18
…rgument mac-cain13#2 ($previousExitCode) must be of type int|false, array given, called in /home/umpirsky/Projects/daemonizable-command/tests/Wrep/Daemonizable/Command/EndlessCommandTest.php on line 117
@umpirsky
Copy link
Contributor Author

Fixed, thanks.

* @param int $signal The signal code to handle
*/
public function handleSignal(int $signal): void
public function handleSignal(int $signal, array|int|false $previousExitCode = 0): int|false
Copy link
Contributor Author

@umpirsky umpirsky May 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added array here because of:

1) Tests\Wrep\Daemonizable\Command\EndlessCommandTest::testInterruptSigtermFromDifferentContext
TypeError: Wrep\Daemonizable\Command\EndlessCommand::handleSignal(): Argument #2 ($previousExitCode) must be of type int|false, array given, called in tests/Wrep/Daemonizable/Command/EndlessCommandTest.php on line 117

src/Wrep/Daemonizable/Command/EndlessCommand.php:83
tests/Wrep/Daemonizable/Command/EndlessCommandTest.php:117
vendor/symfony/console/Command/Command.php:318
src/Wrep/Daemonizable/Command/EndlessCommand.php:75
tests/Wrep/Daemonizable/Command/EndlessCommandTest.php:102

Soemthing that should probably be addressed later on.

@pieterocp
Copy link
Contributor

I've run this for a project and it seems to be working with Symfony 7.3, might be one where we merge it into a symfony 7.3 branch, let people install it and run it for a couple of weeks and then tag it for a release?

@umpirsky
Copy link
Contributor Author

Whatever brings it to a new release is fine, thanks.

@umpirsky
Copy link
Contributor Author

umpirsky commented Jun 2, 2025

Any updates on this?

@mac-cain13
Copy link
Owner

Thanks to you both for the PR and testing it. Highly appreciated!

Will merge this so we can make a release.

@mac-cain13 mac-cain13 merged commit b4a5d93 into mac-cain13:master Jun 2, 2025
@umpirsky umpirsky deleted the handleSignal-7.3 branch June 2, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants