Completed
Push — master ( f18332...65e840 )
by Gabriel
03:52
created

OrderRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A findOrders() 0 14 1
1
<?php
2
3
namespace ThreePlCentral\Order;
4
5
use DateTime;
6
use ThreePlCentral\ThreePlCentral;
7
use ThreePlCentral\RequestFactory;
8
9
class OrderRepository
10
{
11
    public static function findOrders(ThreePlCentral $threepl, DateTime $beginDate, DateTime $endDate): array
12
    {
13
        $request = RequestFactory::create(
14
            $threepl,
15
            'POST',
16
            'http://www.JOI.com/schemas/ViaSub.WMS/FindOrders'
17
        );
18
19
        $request->setTemplate(__DIR__ . '/../Request/findOrders.xml');
20
        $response = $request->fetch([
0 ignored issues
show
Unused Code introduced by
$response is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
21
            'BeginDate' => $beginDate->format('YYYY-MM-DD'),
22
            'EndDate' => $endDate->format('YYYY-MM-DD')
23
        ]);
24
    }
25
}
26