Passed
Push — main ( 936852...10149e )
by Thierry
15:09
created

CallableSessionClass::getSession()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace App\Ajax;
4
5
use Siak\Tontine\Model\Session as SessionModel;
6
use Siak\Tontine\Service\Meeting\SessionService;
7
8
/**
9
 * @databag meeting
10
 * @before getSession
11
 */
12
class CallableSessionClass extends CallableClass
13
{
14
    /**
15
     * @var SessionModel|null
16
     */
17
    protected ?SessionModel $session = null;
18
19
    /**
20
     * @di
21
     * @var SessionService
22
     */
23
    protected SessionService $sessionService;
24
25
    /**
26
     * @return void
27
     */
28
    protected function getSession()
29
    {
30
        $sessionId = $this->bag('meeting')->get('session.id');
31
        $this->session = $this->sessionService->getSession($sessionId);
0 ignored issues
show
Bug introduced by
It seems like $sessionId can also be of type null; however, parameter $sessionId of Siak\Tontine\Service\Mee...onService::getSession() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
        $this->session = $this->sessionService->getSession(/** @scrutinizer ignore-type */ $sessionId);
Loading history...
32
    }
33
34
    /**
35
     * @return void
36
     */
37
    protected function showBalanceAmounts()
38
    {
39
        $this->response->call('showBalanceAmounts');
40
    }
41
}
42