Issues (686)

jaxon-examples/examples/config/code.php (6 issues)

1
<?php
2
3
class HelloWorld
4
{
5
    public function sayHello(bool $isCaps, bool $bNotify = true)
6
    {
7
        $text = $isCaps ? 'HELLO WORLD!' : 'Hello World!';
8
        $xResponse = jaxon()->newResponse();
9
        $xResponse->assign('div2', 'innerHTML', $text);
10
        if(($bNotify))
11
            $xResponse->dialog->success("div2 text is now $text");
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...
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

11
            $xResponse->dialog->/** @scrutinizer ignore-call */ 
12
                                success("div2 text is now $text");
Loading history...
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

11
            $xResponse->dialog->/** @scrutinizer ignore-call */ 
12
                                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...
12
    }
13
14
    public function setColor(string $sColor, bool $bNotify = true)
15
    {
16
        $xResponse = jaxon()->newResponse();
17
        $xResponse->assign('div2', 'style.color', $sColor);
18
        if(($bNotify))
19
            $xResponse->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
        $xResponse = jaxon()->newResponse();
25
        $buttons = [['title' => 'Close', 'class' => 'btn', 'click' => 'close']];
26
        $options = ['width' => 500];
27
        $xResponse->dialog->show("Modal Dialog", "This modal dialog is powered by PgwJs!!", $buttons, $options);
0 ignored issues
show
The method show() 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

27
        $xResponse->dialog->/** @scrutinizer ignore-call */ 
28
                            show("Modal Dialog", "This modal dialog is powered by PgwJs!!", $buttons, $options);
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...
28
    }
29
}
30
31
// Register object
32
$jaxon = jaxon();
33
34
$jaxon->app()->setup(configFile('config.yaml'));
35