OrderQueueController::work()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
rs 10
1
<?php
2
/**
3
 * This file is part of order_management
4
 * User: Sinan TURGUT <[email protected]>
5
 * Date: 24.06.2019
6
 * php version 7.2
7
 *
8
 * @category Assessment
9
 * @package  OrderManagement
10
 * @author   Sinan TURGUT <[email protected]>
11
 * @license  See LICENSE file
12
 * @link     https://dev.sinanturgut.com.tr
13
 */
14
15
namespace OrderManagement\Worker\OrderQueue;
16
17
use OrderManagement\Queue\OrderQueue;
18
use OrderManagement\RabbitMQ\Consumer;
19
use PhpAmqpLib\Message\AMQPMessage;
0 ignored issues
show
Bug introduced by
The type PhpAmqpLib\Message\AMQPMessage 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...
20
21
/**
22
 * Class OrderQueueController
23
 * @package OrderManagement\Worker\OrderQueue
24
 */
25
class OrderQueueController
26
{
27
    /**
28
     * @throws \ErrorException
29
     */
30
    public function work()
31
    {
32
        $consumer = new Consumer(new OrderQueue());
33
34
        $consumer->addCallback(function (AMQPMessage $message) {
0 ignored issues
show
Unused Code introduced by
The parameter $message is not used and could be removed. ( Ignorable by Annotation )

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

34
        $consumer->addCallback(function (/** @scrutinizer ignore-unused */ AMQPMessage $message) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
35
            //echo (':::'.$message);
36
        });
37
38
        $consumer->work(function (string $output) {
0 ignored issues
show
Unused Code introduced by
The parameter $output is not used and could be removed. ( Ignorable by Annotation )

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

38
        $consumer->work(function (/** @scrutinizer ignore-unused */ string $output) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
            //echo $output."\n";
40
        });
41
    }
42
}