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

OrderRepository::findOrders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 1
eloc 9
nc 1
nop 3
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