Completed
Push — master ( fb0370...84a128 )
by Ronaldo
03:03
created

CreateOrderService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 5
dl 0
loc 24
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createOrderBuilder() 0 4 1
A send() 0 8 1
1
<?php
2
3
namespace WSW\SiftScience\Services;
4
5
use WSW\SiftScience\Events\CreateOrder;
6
use WSW\SiftScience\Transformers\CreateOrderTransformer;
7
8
/**
9
 * Class CreateOrderService
10
 *
11
 * @package WSW\SiftScience\Services
12
 * @author Ronaldo Matos Rodrigues <[email protected]>
13
 */
14
class CreateOrderService extends BaseService
15
{
16
    /**
17
     * @return CreateOrder
18
     */
19
    public function createOrderBuilder()
20
    {
21
        return new CreateOrder();
22
    }
23
24
    /**
25
     * @param CreateOrder $createOrder
26
     *
27
     * @return bool
28
     */
29
    public function send(CreateOrder $createOrder)
30
    {
31
        $createOrder->setApiKey($this->credentials->getApiKey());
32
        $body = $this->item($createOrder, new CreateOrderTransformer)->toJson();
33
        $this->post(static::ENDPOINT, $body);
34
35
        return true;
36
    }
37
}
38