Completed
Pull Request — master (#107)
by Glenn
14:03 queued 07:08
created

RecentTasks::placeholder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
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
}