DialogTrait::modal()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Jaxon\App\Dialog;
4
5
use Jaxon\Response\AjaxResponse;
6
7
trait DialogTrait
8
{
9
    /**
10
     * @return AjaxResponse
11
     */
12
    abstract protected function _response(): AjaxResponse;
13
14
    /**
15
     * @return AlertInterface
16
     */
17
    protected function alert(): AlertInterface
18
    {
19
        return $this->_response()->dialog;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->_response()->dialog returns the type Jaxon\Plugin\AbstractResponsePlugin|null which is incompatible with the type-hinted return Jaxon\App\Dialog\AlertInterface.
Loading history...
Bug Best Practice introduced by
The property dialog does not exist on Jaxon\Response\AjaxResponse. Since you implemented __get, consider adding a @property annotation.
Loading history...
20
    }
21
22
    /**
23
     * @return ModalInterface
24
     */
25
    protected function modal(): ModalInterface
26
    {
27
        return $this->_response()->dialog;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->_response()->dialog returns the type Jaxon\Plugin\AbstractResponsePlugin|null which is incompatible with the type-hinted return Jaxon\App\Dialog\ModalInterface.
Loading history...
Bug Best Practice introduced by
The property dialog does not exist on Jaxon\Response\AjaxResponse. Since you implemented __get, consider adding a @property annotation.
Loading history...
28
    }
29
}
30