Test   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 23
rs 10
c 1
b 0
f 0
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A sayHello() 0 6 3
A setColor() 0 5 2
A showDialog() 0 6 1
1
<?php
2
3
namespace Ext\Test;
4
5
class Test extends \Jaxon\App\FuncComponent
6
{
7
    public function sayHello(bool $isCaps, bool $bNotify = true)
8
    {
9
        $text = $isCaps ? 'HELLO WORLD!' : 'Hello World!';
10
        $this->response->assign('div2', 'innerHTML', $text);
11
        if(($bNotify))
12
            $this->response->dialog->success("div2 text is now $text");
0 ignored issues
show
Bug introduced by
The method success() does not exist on null. ( Ignorable by Annotation )

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

12
            $this->response->dialog->/** @scrutinizer ignore-call */ 
13
                                     success("div2 text is now $text");

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug Best Practice introduced by
The property dialog does not exist on Jaxon\Response\Response. Since you implemented __get, consider adding a @property annotation.
Loading history...
Bug introduced by
The method success() does not exist on Jaxon\Plugin\ResponsePluginInterface. It seems like you code against a sub-type of Jaxon\Plugin\ResponsePluginInterface such as Jaxon\Plugin\Response\Dialog\DialogPlugin. ( Ignorable by Annotation )

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

12
            $this->response->dialog->/** @scrutinizer ignore-call */ 
13
                                     success("div2 text is now $text");
Loading history...
13
    }
14
15
    public function setColor(string $sColor, bool $bNotify = true)
16
    {
17
        $this->response->assign('div2', 'style.color', $sColor);
18
        if(($bNotify))
19
            $this->response->dialog->success("div2 color is now $sColor");
0 ignored issues
show
Bug Best Practice introduced by
The property dialog does not exist on Jaxon\Response\Response. Since you implemented __get, consider adding a @property annotation.
Loading history...
20
    }
21
22
    public function showDialog()
23
    {
24
        $buttons = [['title' => 'Close', 'class' => 'btn', 'click' => 'close']];
25
        $width = 300;
26
        $this->response->dialog->with('bootstrap5')->show("Modal Dialog",
0 ignored issues
show
Bug Best Practice introduced by
The property dialog does not exist on Jaxon\Response\Response. Since you implemented __get, consider adding a @property annotation.
Loading history...
Bug introduced by
The method with() does not exist on Jaxon\Plugin\ResponsePluginInterface. It seems like you code against a sub-type of Jaxon\Plugin\ResponsePluginInterface such as Jaxon\Plugin\Response\Dialog\DialogPlugin. ( Ignorable by Annotation )

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

26
        $this->response->dialog->/** @scrutinizer ignore-call */ 
27
                                 with('bootstrap5')->show("Modal Dialog",
Loading history...
27
            "This modal dialog is powered by Twitter Bootstrap!!", $buttons, compact('width'));
28
    }
29
}
30