LogRepository::findById()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 7
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
1
<?php namespace jlourenco\base\Repositories;
2
3
use Cartalyst\Support\Traits\RepositoryTrait;
4
5 View Code Duplication
class LogRepository implements LogRepositoryInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
{
7
    use RepositoryTrait;
8
9
    /**
10
     * The Logs model name.
11
     *
12
     * @var string
13
     */
14
    protected $model = 'jlourenco\base\Models\Logs';
15
16
    /**
17
     * Create a new log repository.
18
     *
19
     * @param  string  $model
20
     */
21
    public function __construct($model = null)
22
    {
23
        if (isset($model))
24
            $this->model = $model;
25
    }
26
27
    /**
28
     * {@inheritDoc}
29
     */
30
    public function findById($id)
31
    {
32
        return $this
33
            ->createModel()
34
            ->newQuery()
35
            ->find($id);
36
    }
37
38
}
39