Passed
Push — main ( 106d28...df360d )
by PRATIK
13:25
created

DurationSpendOnSite::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
namespace Adminetic\Website\Http\Livewire\Admin\Analytics;
4
5
use Analytics;
0 ignored issues
show
Bug introduced by
The type Analytics was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Spatie\Analytics\Period;
7
use Livewire\Component;
0 ignored issues
show
Bug introduced by
The type Livewire\Component was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
class DurationSpendOnSite extends Component
10
{
11
    public $days = 7;
12
13
    public function render()
14
    {
15
        $site_durations = Analytics::performQuery(
16
            Period::days($this->days),
17
            'ga:sessionDuration',
18
            [
19
                'metrics' => 'ga:sessions,ga:sessionDuration',
20
            ]
21
        )->rows;
22
        return view('website::livewire.admin.analytics.duration-spend-on-site', compact('site_durations'));
23
    }
24
}
25