-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329: fix supporting for PHP 8.2 types (null, fals…
…e, true) [Fix] PHP 8.2 types (null, false, true)
- Loading branch information
Showing
6 changed files
with
123 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of Temporal package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Temporal\Tests\Activity; | ||
|
||
use Temporal\Activity\ActivityInterface; | ||
use Temporal\Activity\ActivityMethod; | ||
/* | ||
todo: uncomment this with min php 8.2 requirement or when we can skip activities loading depending on php version | ||
#[ActivityInterface(prefix: "Php82.")] | ||
class Php82TypesActivity | ||
{ | ||
#[ActivityMethod] | ||
public function returnNull(null $value): null | ||
{ | ||
return $value; | ||
} | ||
#[ActivityMethod] | ||
public function returnTrue(true $value): true | ||
{ | ||
return $value; | ||
} | ||
#[ActivityMethod] | ||
public function returnFalse(false $value): false | ||
{ | ||
return $value; | ||
} | ||
}*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of Temporal package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Temporal\Tests\Workflow; | ||
|
||
use Temporal\Activity\ActivityOptions; | ||
use Temporal\Common\RetryOptions; | ||
use Temporal\Tests\Activity\Php82TypesActivity; | ||
use Temporal\Workflow; | ||
use Temporal\Workflow\WorkflowMethod; | ||
|
||
#[Workflow\WorkflowInterface] | ||
class Php82TypesWorkflow | ||
{ | ||
#[WorkflowMethod(name: 'Php82TypesWorkflow')] | ||
public function handler(): iterable | ||
{ | ||
$simple = Workflow::newActivityStub( | ||
Php82TypesActivity::class, | ||
ActivityOptions::new() | ||
->withStartToCloseTimeout(5) | ||
->withRetryOptions( | ||
RetryOptions::new()->withMaximumAttempts(2), | ||
), | ||
); | ||
|
||
return [ | ||
yield $simple->returnNull(null), | ||
yield $simple->returnTrue(true), | ||
yield $simple->returnFalse(false), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters