SessionPanel   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 27
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAttributes() 0 19 3
1
<?php
2
3
namespace Recca0120\LaravelTracy\Panels;
4
5
use Recca0120\LaravelTracy\Contracts\IAjaxPanel;
6
7
class SessionPanel extends AbstractPanel implements IAjaxPanel
8
{
9
    /**
10
     * getAttributes.
11
     *
12
     * @return array
13
     */
14
    protected function getAttributes()
15
    {
16
        $rows = [];
17
        if ($this->hasLaravel() === true) {
18
            $session = $this->laravel['session'];
19
            $rows = [
20
                'sessionId' => $session->getId(),
21
                'sessionConfig' => $session->getSessionConfig(),
22
                'laravelSession' => $session->all(),
23
            ];
24
        }
25
26
        if (session_status() === PHP_SESSION_ACTIVE) {
27
            $rows['nativeSessionId'] = session_id();
28
            $rows['nativeSession'] = $_SESSION;
29
        }
30
31
        return compact('rows');
32
    }
33
}
34