Skip to content

Commit

Permalink
Fix compatibility with symfony/console v7 (#51)
Browse files Browse the repository at this point in the history
* Add `symfony/console` as a dependency; update readme: add link to updates

---------

Co-authored-by: roxblnfk <[email protected]>
  • Loading branch information
sithuaung and roxblnfk authored Mar 12, 2024
1 parent 9b2f0b0 commit cc56af0
Show file tree
Hide file tree
Showing 35 changed files with 37 additions and 34 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ The following samples demonstrate much of the basic functionality and capabiliti

- **[Signal](https://github.com/temporalio/samples-php/tree/master/app/src/Signal)**: Example of sending and handling a Signal

- **[Update](https://github.com/temporalio/samples-php/tree/master/app/src/Updates)**: Example of Workflow Update feature

- **[Saga](https://github.com/temporalio/samples-php/tree/master/app/src/Saga)**: Example of SAGA pattern support

- **[SearchAttributes](https://github.com/temporalio/samples-php/tree/master/app/src/SearchAttributes)**: Example of Custom search attributes that can be used to find Workflows using predicates
Expand Down
3 changes: 2 additions & 1 deletion app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"spiral/tokenizer": "^3.7",
"temporal/open-telemetry-interceptors": "dev-master",
"open-telemetry/exporter-otlp": "^0.0.17",
"open-telemetry/transport-grpc": "^0.0.17"
"open-telemetry/transport-grpc": "^0.0.17",
"symfony/console": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
"buggregator/trap": "^1.3"
Expand Down
2 changes: 1 addition & 1 deletion app/src/ActivityRetry/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'activity-retry';
protected const DESCRIPTION = 'Execute ActivityRetry\GreetingWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
GreetingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/AsyncActivity/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'async-activity';
protected const DESCRIPTION = 'Execute AsyncActivity\GreetingWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
AsyncGreetingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/AsyncActivityCompletion/CompleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CompleteCommand extends Command
['message', InputArgument::REQUIRED, 'Activity token'],
];

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
// @@@SNIPSTART samples-php-async-activity-completion-completebytoken
$client = $this->workflowClient->newActivityCompletionClient();
Expand Down
2 changes: 1 addition & 1 deletion app/src/AsyncActivityCompletion/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'user-activity:start';
protected const DESCRIPTION = 'Execute AsyncActivityCompletion\GreetingWorkflow and wait for user greeting';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
GreetingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/AsyncClosure/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'async-closure';
protected const DESCRIPTION = 'Execute AsyncClosure\GreetingWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
AsyncGreetingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/BookingSaga/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'booking-saga';
protected const DESCRIPTION = 'Execute BookingSaga\TripBookingWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
TripBookingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/CancellationScope/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'cancellation-scope';
protected const DESCRIPTION = 'Execute CancellationScope\GreetingWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
GreetingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Child/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'child';
protected const DESCRIPTION = 'Execute Child\ParentWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
ParentWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Cron/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ExecuteCommand extends Command
protected const NAME = 'cron';
protected const DESCRIPTION = 'Start Cron\CronWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
// Sets the cron schedule using the WorkflowOptions.
// The cron format is parsed by "https://github.com/robfig/cron" library.
Expand Down
2 changes: 1 addition & 1 deletion app/src/Exception/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ExecuteCommand extends Command
protected const NAME = 'exception';
protected const DESCRIPTION = 'Execute Exception\FailedWorkflow with multiple signals';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
FailedWorkflow::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/FileProcessing/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ExecuteCommand extends Command
['url', InputArgument::REQUIRED, 'Download URL']
];

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
FileProcessingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Interceptors/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ExecuteCommand extends Command
protected const NAME = 'interceptors';
protected const DESCRIPTION = 'Execute workflow with interceptors';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
TestActivityAttributesInterceptor::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/LocalActivity/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'local-activity';
protected const DESCRIPTION = 'Execute LocalActivity\GreetingWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
GreetingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/MoneyBatch/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'money-batch';
protected const DESCRIPTION = 'Execute MoneyBatch\MoneyBatchWorkflow with multiple signals and queries';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
MoneyBatchWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/MoneyTransfer/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ExecuteCommand extends Command
protected const NAME = 'money-transfer';
protected const DESCRIPTION = 'Execute MoneyTransferWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(AccountTransferWorkflowInterface::class);
$output->writeln("Starting <comment>MoneyTransferWorkflow</comment>... ");
Expand Down
2 changes: 1 addition & 1 deletion app/src/Periodic/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'periodic:start';
protected const DESCRIPTION = 'Start Periodic\PeriodicWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
PeriodicWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Periodic/StopCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class StopCommand extends Command
protected const NAME = 'periodic:stop';
protected const DESCRIPTION = 'Stop Periodic\PeriodicWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newUntypedRunningWorkflowStub(
PeriodicWorkflowInterface::WORKFLOW_ID
Expand Down
2 changes: 1 addition & 1 deletion app/src/PolymorphicActivity/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'polymorphic';
protected const DESCRIPTION = 'Execute PolymorphicActivity\GreetingWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
GreetingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Query/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'query';
protected const DESCRIPTION = 'Execute Query\QueryWorkflow with additional query and timer';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
QueryWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Replay/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ExecuteCommand extends Command
];
protected const DESCRIPTION = 'Replay workflow executions from history events';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$replayer = new WorkflowReplayer();
$workflowType = $input->getArgument('workflow-type');
Expand Down
2 changes: 1 addition & 1 deletion app/src/Saga/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'saga';
protected const DESCRIPTION = 'Execute Saga\SagaWorkflow with multiple signals';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
SagaWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Schedule/CreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CreateCommand extends Command
];


public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$specInit = $spec = Schedule\Spec\ScheduleSpec::new()
->withJitter('10m');
Expand Down
2 changes: 1 addition & 1 deletion app/src/Schedule/DeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DeleteCommand extends Command
protected const NAME = 'schedule:delete';
protected const DESCRIPTION = 'Delete scheduled workflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$handle = $this->scheduleClient->getHandle(ScheduleWorkflowInterface::SCHEDULE_ID);

Expand Down
2 changes: 1 addition & 1 deletion app/src/Schedule/DescribeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DescribeCommand extends Command
protected const NAME = 'schedule:describe';
protected const DESCRIPTION = 'Describe the Schedule';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$handle = $this->scheduleClient->getHandle(ScheduleWorkflowInterface::SCHEDULE_ID);

Expand Down
2 changes: 1 addition & 1 deletion app/src/Schedule/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ListCommand extends Command
protected const NAME = 'schedule:list';
protected const DESCRIPTION = 'List all Schedules';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$schedules = $this->scheduleClient->listSchedules();

Expand Down
2 changes: 1 addition & 1 deletion app/src/SearchAttributes/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'search-attributes';
protected const DESCRIPTION = 'Execute SearchAttributes\GreetingWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
GreetingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Signal/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExecuteCommand extends Command
protected const NAME = 'signal';
protected const DESCRIPTION = 'Execute Signal\SignalWorkflow with multiple signals';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
SignalWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/SimpleActivity/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ExecuteCommand extends Command
protected const NAME = 'simple-activity';
protected const DESCRIPTION = 'Execute SimpleActivity\GreetingWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
GreetingWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Subscription/CancelCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CancelCommand extends Command
['userID', InputArgument::REQUIRED, 'Unique user ID']
];

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$userID = $input->getArgument('userID');

Expand Down
2 changes: 1 addition & 1 deletion app/src/Subscription/SubscribeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SubscribeCommand extends Command
['userID', InputArgument::REQUIRED, 'Unique user ID']
];

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$userID = $input->getArgument('userID');

Expand Down
2 changes: 1 addition & 1 deletion app/src/UpdatableTimer/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ExecuteCommand extends Command
protected const NAME = 'updatable-timer:start';
protected const DESCRIPTION = 'Execute UpdatableTimer\DynamicSleepWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newWorkflowStub(
DynamicSleepWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/UpdatableTimer/ProlongCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ProlongCommand extends Command
protected const NAME = 'updatable-timer:prolong';
protected const DESCRIPTION = 'Prolong the duration of UpdatableTimer\DynamicSleepWorkflow';

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$workflow = $this->workflowClient->newRunningWorkflowStub(
DynamicSleepWorkflowInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Updates/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ExecuteCommand extends Command
private InputInterface $input;
private OutputInterface $output;

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$this->input = $input;
$this->output = $output;
Expand Down

0 comments on commit cc56af0

Please sign in to comment.