Repeater   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A for() 0 3 1
A find() 0 3 1
1
<?php
2
3
namespace Chuckbe\Chuckcms\Chuck\Accessors;
4
5
use Chuckbe\Chuckcms\Chuck\RepeaterRepository;
6
use Chuckbe\Chuckcms\Models\Repeater as RepeaterModel;
7
8
class Repeater
9
{
10
    private $repeaterRepository;
11
    private $repeater;
12
13
    public function __construct(RepeaterModel $repeater, RepeaterRepository $repeaterRepository)
14
    {
15
        $this->repeater = $repeater;
16
        $this->repeaterRepository = $repeaterRepository;
17
    }
18
19
    public function for(string $string)
20
    {
21
        return $this->repeater->where('slug', $string)->get();
22
    }
23
24
    public function find($id)
25
    {
26
        return $this->repeater->where('id', $id)->first();
27
    }
28
}
29