OrderController::show()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
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 5
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\Http\Controller;
16
17
use OrderManagement\Queue\OrderQueue;
18
use OrderManagement\RabbitMQ\Publisher;
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 OrderController
23
 * @package OrderManagement\Http\Controller
24
 */
25
class OrderController
26
{
27
    /**
28
     *
29
     */
30
    public function create()
31
    {
32
        $publisher = new Publisher(new OrderQueue());
33
        $publisher->publish('ürün adı');
34
35
        echo json_encode([
36
            'status' => 'created',
37
            'hostname' => getenv('HOSTNAME'),
38
        ], JSON_PRETTY_PRINT);
39
    }
40
41
    /**
42
     *
43
     */
44
    public function show()
45
    {
46
        echo json_encode([
47
            'hostname' => getenv('HOSTNAME'),
48
        ], JSON_PRETTY_PRINT);
49
    }
50
}
51