TimerProcessMetricsCronJob::isImmediate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace Hhxsv5\LaravelS\Components\Prometheus;
4
5
use Hhxsv5\LaravelS\Components\Prometheus\Collectors\SwooleProcessCollector;
6
use Hhxsv5\LaravelS\Swoole\Timer\CronJob;
7
8
class TimerProcessMetricsCronJob extends CronJob
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class TimerProcessMetricsCronJob
Loading history...
9
{
10
    public function interval()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function interval()
Loading history...
11
    {
12
        return config('prometheus.collect_metrics_interval', 10) * 1000;
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

12
        return /** @scrutinizer ignore-call */ config('prometheus.collect_metrics_interval', 10) * 1000;
Loading history...
13
    }
14
15
    public function isImmediate()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function isImmediate()
Loading history...
16
    {
17
        return true;
18
    }
19
20
    public function run()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function run()
Loading history...
21
    {
22
        /**@var SwooleProcessCollector $processCollector */
0 ignored issues
show
Coding Style introduced by
The open comment tag must be the only content on the line
Loading history...
Coding Style introduced by
The close comment tag must be the only content on the line
Loading history...
Coding Style introduced by
Missing short description in doc comment
Loading history...
23
        $processCollector = app(SwooleProcessCollector::class);
0 ignored issues
show
Bug introduced by
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        $processCollector = /** @scrutinizer ignore-call */ app(SwooleProcessCollector::class);
Loading history...
24
        $processCollector->collect([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
25
            'process_id'   => 'timer',
26
            'process_type' => 'timer',
27
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
28
    }
29
}