Completed
Pull Request — master (#107)
by Glenn
25:10 queued 16:41
created

RecentTasks::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
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
}