Repository   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBusiness() 0 6 2
A getService() 0 6 2
1
<?php
2
3
namespace Timegridio\Concierge;
4
5
use Timegridio\Concierge\Models\Business;
6
7
class Repository
8
{
9
    /**
10
     * Default lookup identificator.
11
     *
12
     * @var string
13
     */
14
    private $identificator = 'slug';
15
16 1
    public function getBusiness($id, $identificator = null)
17
    {
18 1
        $identificator = $identificator ?: $this->identificator;
19
20 1
        return Business::where($identificator, $id)->first();
21
    }
22
23 3
    public function getService($business, $id, $identificator = null)
24
    {
25 3
        $identificator = $identificator ?: $this->identificator;
26
27 3
        return $business->services()->where($identificator, $id)->first();
28
    }
29
}
30