Order::serialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: WilliamWard
5
 */
6
7
namespace GivePay\Gateway\Transactions;
8
9
final class Order
10
{
11
12
    /**
13
     * @var string The order ID
14
     */
15
    private $orderId;
16
17
    /**
18
     * Order constructor.
19
     * @param string $orderId The order Id for the order
20
     */
21 1
    public function __construct($orderId)
22
    {
23 1
        $this->orderId = $orderId;
24 1
    }
25
26
    /**
27
     * Serializes the order GPG API object
28
     * @return array serialized object
29
     */
30 1
    public function serialize()
31
    {
32
        return [
33 1
            'order_number' => $this->orderId
34
        ];
35
    }
36
}