SessionBackend   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 23
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 4 1
A getBackend() 0 7 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Filoucrackeur\StorageFrameworkManager\Domain\Model\Dto;
5
6
use Filoucrackeur\StorageFrameworkManager\Type\Backend\Type;
7
use TYPO3\CMS\Core\Session\Backend\SessionBackendInterface;
8
use TYPO3\CMS\Core\Session\SessionManager;
9
use TYPO3\CMS\Core\Utility\GeneralUtility;
10
11
class SessionBackend extends AbstractBackendInterface
12
{
13
    /**
14
     * @var SessionBackendInterface
15
     */
16
    protected $backend;
17
18
    /**
19
     * @return string
20
     */
21
    public function getType(): string
22
    {
23
        return Type::SESSION;
24
    }
25
26
    public function getBackend()
27
    {
28
        /** @var SessionManager $cm */
29
        $sm = GeneralUtility::makeInstance(SessionManager::class);
30
        $backend = $sm->getSessionBackend($this->getIdentifier());
31
        return $backend;
32
    }
33
}
34