TotalUniqueUsersBoxComposer::compose()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 11
ccs 0
cts 4
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php namespace Arcanesoft\Tracker\ViewComposers\Dashboard;
2
3
use Arcanesoft\Tracker\Support\DateRange;
4
use Arcanesoft\Tracker\ViewComposers\AbstractViewComposer;
5
use Illuminate\Contracts\View\View;
6
7
/**
8
 * Class     TotalUniqueUsersBoxComposer
9
 *
10
 * @package  Arcanesoft\Tracker\ViewComposers\Dashboard
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class TotalUniqueUsersBoxComposer extends AbstractViewComposer
14
{
15
    /* -----------------------------------------------------------------
16
     |  Constants
17
     | -----------------------------------------------------------------
18
     */
19
20
    const VIEW = 'tracker::admin._composers.dashboard.total-unique-visitors-box';
21
22
    /* -----------------------------------------------------------------
23
     |  Main Methods
24
     | -----------------------------------------------------------------
25
     */
26
27
    /**
28
     * Compose the view.
29
     *
30
     * @param  \Illuminate\Contracts\View\View  $view
31
     */
32
    public function compose(View $view)
33
    {
34
        /**
35
         * @var  \Carbon\Carbon                  $start
36
         * @var  \Carbon\Carbon                  $end
37
         * @var  \Illuminate\Support\Collection  $range
38
         */
39
        extract(DateRange::getCurrentMonthDaysRange());
0 ignored issues
show
Bug introduced by
\Arcanesoft\Tracker\Supp...CurrentMonthDaysRange() cannot be passed to extract() as the parameter $var_array expects a reference.
Loading history...
40
41
        $view->with('uniqueUsersCount', $this->getVisitorsFilteredByDateRange($start, $end)->count());
42
    }
43
}
44