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

Factory::fromArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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