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::getOpenOrders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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