Passed
Pull Request — master (#577)
by Dmitriy
09:18
created

FastWorkflow   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 15 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Temporal\Workflow;
6
7
use App\Temporal\Activity\CommonActivity;
8
use Temporal\Activity\ActivityOptions;
0 ignored issues
show
Bug introduced by
The type Temporal\Activity\ActivityOptions was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Temporal\Promise;
0 ignored issues
show
Bug introduced by
The type Temporal\Promise was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Temporal\Workflow;
0 ignored issues
show
Bug introduced by
The type Temporal\Workflow was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
#[\Temporal\Workflow\WorkflowInterface]
13
final class FastWorkflow
14
{
15
    #[\Temporal\Workflow\WorkflowMethod('fast_workflow')]
16
    public function run(string $name, int $count): \Generator
17
    {
18
        $activity = Workflow::newActivityStub(
19
            CommonActivity::class,
20
            ActivityOptions::new()
21
                ->withStartToCloseTimeout(5)
22
        );
23
        $promises = [];
24
25
        foreach (range(1, $count) as $item) {
26
            $promises[] = $activity->fast($name);
27
        }
28
29
        return yield Promise::all($promises);
30
    }
31
}
32