Completed
Push — master ( 9792a6...aaaf86 )
by recca
10:22
created

SessionPanel   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 10
c 0
b 0
f 0
ccs 11
cts 11
cp 1
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 1
    protected function getAttributes()
15
    {
16 1
        $rows = [];
17 1
        if ($this->hasLaravel() === true) {
18 1
            $session = $this->laravel['session'];
19
            $rows = [
20 1
                'sessionId' => $session->getId(),
21 1
                'sessionConfig' => $session->getSessionConfig(),
22 1
                'laravelSession' => $session->all(),
23
            ];
24
        }
25
26 1
        if (session_status() === PHP_SESSION_ACTIVE) {
27 1
            $rows['nativeSessionId'] = session_id();
28 1
            $rows['nativeSession'] = $_SESSION;
29
        }
30
31 1
        return compact('rows');
32
    }
33
}
34