Passed
Pull Request — master (#4)
by Morten Poul
05:31 queued 02:55
created

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 19
rs 10
c 2
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 7 1
A fromConfig() 0 7 1
1
<?php
2
3
namespace Signifly\Shopify;
4
5
class Factory
6
{
7
    public static function fromConfig(): Shopify
8
    {
9
        return new Shopify(
10
            config('shopify.credentials.api_key'),
11
            config('shopify.credentials.password'),
12
            config('shopify.credentials.domain'),
13
            config('shopify.credentials.api_version'),
14
        );
15
    }
16
17
    public static function fromArray(array $data): Shopify
18
    {
19
        return new Shopify(
20
            $data['api_key'],
21
            $data['password'],
22
            $data['domain'],
23
            $data['api_version']
24
        );
25
    }
26
}
27