Passed
Push — master ( b1742c...4b0d05 )
by Arthur
101:17 queued 94:42
created

HandlesNullResource::exists()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arthur
5
 * Date: 15.11.18
6
 * Time: 19:49
7
 */
8
9
namespace Foundation\Traits;
10
11
12
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
13
14
trait HandlesNullResource
15
{
16
    public function exists($model){
17
        if ($model === null) {
18
            throw new NotFoundHttpException('Could not found resource.');
19
        }
20
    }
21
}