Issues (1019)

Prometheus/TimerProcessMetricsCronJob.php (12 issues)

1
<?php
2
0 ignored issues
show
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
Missing doc comment for class TimerProcessMetricsCronJob
Loading history...
9
{
10
    public function interval()
0 ignored issues
show
Missing doc comment for function interval()
Loading history...
11
    {
12
        return config('prometheus.collect_metrics_interval', 10) * 1000;
0 ignored issues
show
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
Missing doc comment for function isImmediate()
Loading history...
16
    {
17
        return true;
18
    }
19
20
    public function run()
0 ignored issues
show
Missing doc comment for function run()
Loading history...
21
    {
22
        /**@var SwooleProcessCollector $processCollector */
0 ignored issues
show
The open comment tag must be the only content on the line
Loading history...
The close comment tag must be the only content on the line
Loading history...
Missing short description in doc comment
Loading history...
23
        $processCollector = app(SwooleProcessCollector::class);
0 ignored issues
show
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
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
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
}