Completed
Push — master ( 9b3fc3...96b827 )
by ARCANEDEV
06:21
created

ViewComposer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A cacheResults() 0 4 1
1
<?php namespace Arcanesoft\Seo\ViewComposers;
2
3
use Closure;
4
use Illuminate\Support\Facades\Cache;
5
6
/**
7
 * Class     ViewComposer
8
 *
9
 * @package  Arcanesoft\Seo\Bases
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class ViewComposer
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Properties
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * The View instance.
20
     *
21
     * @var \Illuminate\Contracts\View\View
22
     */
23
    protected $view;
24
25
    /**
26
     * Caching time.
27
     *
28
     * @var int
29
     */
30
    protected $minutes = 5;
31
32
    /* ------------------------------------------------------------------------------------------------
33
     |  Other Functions
34
     | ------------------------------------------------------------------------------------------------
35
     */
36
    /**
37
     * Cache the results.
38
     *
39
     * @param  string    $name
40
     * @param  \Closure  $callback
41
     *
42
     * @return mixed
43
     */
44
    protected function cacheResults($name, Closure $callback)
45
    {
46
        return Cache::remember('cache::' . $name, $this->minutes, $callback);
47
    }
48
}
49