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

FastWorkflow::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 2
eloc 9
c 2
b 1
f 0
nc 2
nop 2
dl 0
loc 15
rs 9.9666
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