Base   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 3
c 0
b 0
f 0
dl 0
loc 14
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUserByFastspringId() 0 5 2
1
<?php
2
/**
3
 * This file implements Base.
4
 *
5
 * @author    Bilal Gultekin <[email protected]>
6
 * @author    Justin Hartman <[email protected]>
7
 * @copyright 2019 22 Digital
8
 * @license   MIT
9
 * @since     v0.1
10
 */
11
12
namespace TwentyTwoDigital\CashierFastspring\Listeners;
13
14
/**
15
 * This class describes a base.
16
 */
17
class Base
18
{
19
    /**
20
     * Get the billable entity instance by Fastspring ID.
21
     *
22
     * @param string $fastspringId
23
     *
24
     * @return \TwentyTwoDigital\CashierFastspring\Billable
25
     */
26 5
    public function getUserByFastspringId($fastspringId)
27
    {
28 5
        $model = getenv('FASTSPRING_MODEL') ?: config('services.fastspring.model');
29
30 5
        return (new $model())->where('fastspring_id', $fastspringId)->first();
31
    }
32
}
33