Completed
Pull Request — master (#107)
by Tim
15:40 queued 06:25
created

RecentTasks   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A placeholder() 0 4 1
A run() 0 6 1
1
<?php
2
3
namespace App\Widgets;
4
5
use Arrilot\Widgets\AbstractWidget;
6
7
class RecentTasks extends AbstractWidget
8
{
9
    public function __construct()
10
    {
11
       $this->reloadTimeout = config('timecontrol.refreshInterval');
12
    }
13
14
    /**
15
     * The configuration array.
16
     *
17
     * @var array
18
     */
19
    protected $config = [
20
    'count' => 10,
21
    ];
22
23
    /**
24
     * The number of seconds before each reload.
25
     *
26
     * @var int|float
27
     */
28
    public $reloadTimeout;
29
30
31
    /**
32
     * The number of minutes before cache expires.
33
     * False means no caching at all.
34
     *
35
     * @var int|float|bool
36
     */
37
    public $cacheTime = false;
38
39
40
    public function placeholder()
41
    {
42
    return "Loading...";
43
    }
44
45
    /**
46
     * Treat this method as a controller action.
47
     * Return view() or other content to display.
48
     */
49
    public function run()
50
    {
51
        return view("widgets.recent_tasks", [
52
            'config' => $this->config,
53
        ]);
54
    }
55
56
57
}