Process::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 13
rs 10
c 1
b 0
f 0
1
<?php
2
3
use PhpAmqpLib\Message\AMQPMessage;
4
5
class Process implements \WillRy\RabbitRun\PubSub\WorkerInterface
0 ignored issues
show
Bug introduced by
The type WillRy\RabbitRun\PubSub\WorkerInterface 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...
6
{
7
8
    public function handle(\WillRy\RabbitRun\PubSub\Task $data)
0 ignored issues
show
Bug introduced by
The type WillRy\RabbitRun\PubSub\Task 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
    {
10
        $body = $data->getData();
0 ignored issues
show
Unused Code introduced by
The assignment to $body is dead and can be removed.
Loading history...
11
12
        /**
13
         * Fazer o processamento que for necessário
14
         */
15
16
        //simulando um erro qualquer para exemplo
17
        // $fakeException = rand() % 2 === 0;
18
        // if ($fakeException) throw new \Exception("=== Erro ===");
19
20
        echo "Processado".PHP_EOL;
21
22
23
        /** Marca o item como erro */
24
        //$data->nackError();
25
26
        /** Marca o item como cancelado */
27
        //$data->nackCancel();
28
    }
29
30
31
    public function error(array $databaseData, Exception $error = null)
32
    {
33
34
    }
35
}
36