Completed
Push — master ( 9e3b82...1525fb )
by
unknown
10:24 queued 06:58
created

OrderByUpdateDateDescendingCriteria   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 4 1
1
<?php
2
3
namespace App\Ship\Criterias\Eloquent;
4
5
use App\Ship\Parents\Criterias\Criteria;
6
use Prettus\Repository\Contracts\RepositoryInterface as PrettusRepositoryInterface;
7
8
/**
9
 * Class OrderByUpdateDateDescendingCriteria
10
 *
11
 * @author  Johannes Schobel <[email protected]>
12
 */
13
class OrderByUpdateDateDescendingCriteria extends Criteria
14
{
15
16
    /**
17
     * @param                                                   $model
18
     * @param \Prettus\Repository\Contracts\RepositoryInterface $repository
19
     *
20
     * @return mixed
21
     */
22
    public function apply($model, PrettusRepositoryInterface $repository)
23
    {
24
        return $model->orderBy('updated_at', 'desc');
25
    }
26
27
}
28