GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( c86075...9f417a )
by Kevin
03:40
created

BolComRetailerService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getOpenOrders() 0 7 1
1
<?php
2
3
namespace HomeDesignShops\LaravelBolComRetailer;
4
5
use Illuminate\Support\Collection;
6
use Picqer\BolRetailer\Client as BolRetailerClient;
7
use Picqer\BolRetailer\Model\ReducedOrder;
8
use Picqer\BolRetailer\Order;
9
10
class BolComRetailerService
11
{
12
13
    /**
14
     * BolComRetailer constructor.
15
     */
16
    public function __construct()
17
    {
18
        BolRetailerClient::setDemoMode(config('bol-com-retailer.use_demo_mode'));
19
        BolRetailerClient::setCredentials(
20
            config('bol-com-retailer.client_id'),
21
            config('bol-com-retailer.client_secret')
22
        );
23
    }
24
25
    /**
26
     * Returns a collection of the open orders.
27
     *
28
     * @return Collection
29
     */
30
    public function getOpenOrders(): Collection
31
    {
32
        return collect(Order::all())
33
            ->transform(static function (ReducedOrder $reducedOrder) {
34
                return Order::get($reducedOrder->orderId);
35
            });
36
    }
37
38
}
39