Issues (686)

jaxon-examples/examples/bind-component/code.php (4 issues)

1
<?php
2
3
use Jaxon\App\FuncComponent;
4
use Jaxon\App\NodeComponent;
5
6
class HelloText extends NodeComponent
7
{
8
    public function html(): string
9
    {
10
        return $this->stash()->get('is_caps') ? 'HELLO WORLD!' : 'Hello World!';
11
    }
12
}
13
14
class HelloWorld extends FuncComponent
15
{
16
    public function sayHello(bool $isCaps)
17
    {
18
        $this->stash()->set('is_caps', $isCaps);
0 ignored issues
show
The method stash() does not exist on HelloWorld. ( Ignorable by Annotation )

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

18
        $this->/** @scrutinizer ignore-call */ 
19
               stash()->set('is_caps', $isCaps);

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...
19
20
        $this->response->bind('div2', rq(HelloText::class));
0 ignored issues
show
Bug Best Practice introduced by
The property response does not exist on HelloWorld. Did you maybe forget to declare it?
Loading history...
21
        $this->cl(HelloText::class)->render();
0 ignored issues
show
The method cl() does not exist on HelloWorld. ( Ignorable by Annotation )

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

21
        $this->/** @scrutinizer ignore-call */ 
22
               cl(HelloText::class)->render();

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...
22
    }
23
24
    public function setColor(string $sColor)
25
    {
26
        $this->response->assign('div2', 'style.color', $sColor);
0 ignored issues
show
Bug Best Practice introduced by
The property response does not exist on HelloWorld. Did you maybe forget to declare it?
Loading history...
27
    }
28
}
29
30
// Register object
31
$jaxon = jaxon();
32
33
$jaxon->app()->setup(configFile('class.php'));
34
// Js options
35
$jaxon->setOptions(['lib' => ['uri' => '/js'], 'app' => ['minify' => false]], 'js');
36
$jaxon->register(Jaxon\Jaxon::CALLABLE_CLASS, HelloText::class);
37