TestDialogLibrary   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 13
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
1
<?php
2
3
use Jaxon\App\CallableClass;
4
use Jaxon\App\Dialog\Library\LibraryInterface;
5
use Jaxon\App\Dialog\Library\ConfirmInterface;
6
use Jaxon\Dialogs\Dialog\AbstractLibrary;
7
8
class Dialog extends CallableClass
9
{
10
    public function success()
11
    {
12
        $this->response->dialog->title('Success')->success('This is a message!!');
0 ignored issues
show
Bug introduced by
The method title() 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
                                 title('Success')->success('This is a message!!');
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 title() 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
                                 title('Success')->success('This is a message!!');

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...
13
    }
14
15
    public function info()
16
    {
17
        $this->response->dialog->title('Info')->info('This is a message!!');
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...
18
    }
19
20
    public function warning()
21
    {
22
        $this->response->dialog->title('Warning')->warning('This is a message!!');
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...
23
    }
24
25
    public function error()
26
    {
27
        $this->response->dialog->title('Error')->error('This is a message!!');
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...
28
    }
29
30
    public function show()
31
    {
32
        $this->response->dialog->show('Dialog', 'This is the dialog content!!',
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 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

32
        $this->response->dialog->/** @scrutinizer ignore-call */ 
33
                                 show('Dialog', 'This is the dialog content!!',
Loading history...
33
            [['title' => 'Save', 'class' => 'btn', 'click' => $this->rq()->save()->confirm('Save?')]]);
0 ignored issues
show
Bug introduced by
The method save() does not exist on Jaxon\Script\Call\JxnCall. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

33
            [['title' => 'Save', 'class' => 'btn', 'click' => $this->rq()->/** @scrutinizer ignore-call */ save()->confirm('Save?')]]);
Loading history...
34
    }
35
36
    public function showWith()
37
    {
38
        $this->response->dialog->with('bootbox')->show('Dialog', 'This is the dialog content!!',
0 ignored issues
show
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

38
        $this->response->dialog->/** @scrutinizer ignore-call */ 
39
                                 with('bootbox')->show('Dialog', 'This is the dialog content!!',
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...
39
            [['title' => 'Save', 'class' => 'btn', 'click' => $this->rq()->save()->confirm('Save?')]]);
40
    }
41
42
    public function hide()
43
    {
44
        $this->response->dialog->hide();
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 hide() 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

44
        $this->response->dialog->/** @scrutinizer ignore-call */ 
45
                                 hide();
Loading history...
45
    }
46
}
47
48
class TestDialogLibrary extends AbstractLibrary implements LibraryInterface, ConfirmInterface
49
{
50
    /**
51
     * @const The library name
52
     */
53
    public const NAME = 'test';
54
55
    /**
56
     * @inheritDoc
57
     */
58
    public function getName(): string
59
    {
60
        return self::NAME;
61
    }
62
}
63
64
interface TestInterface
65
{
66
    public function do();
67
}
68
69
class ClassWithInterface implements TestInterface
70
{
71
    public function do()
72
    {
73
        // Do something
74
    }
75
}
76