Completed
Push — master ( f328e9...1657f1 )
by ARCANEDEV
13s
created

PathTracker   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 18
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A track() 0 4 1
1
<?php namespace Arcanedev\LaravelTracker\Trackers;
2
3
use Arcanedev\LaravelTracker\Contracts\Trackers\PathTracker as PathTrackerContract;
4
use Arcanedev\LaravelTracker\Models\Path;
5
6
/**
7
 * Class     PathTracker
8
 *
9
 * @package  Arcanedev\LaravelTracker\Trackers
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class PathTracker implements PathTrackerContract
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Main Functions
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * Track the path.
20
     *
21
     * @param  string  $path
22
     *
23
     * @return int
24
     */
25 12
    public function track($path)
26
    {
27 12
        return Path::firstOrCreate(compact('path'))->id;
28
    }
29
}
30