|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* ToastrLibrary.php |
|
5
|
|
|
* |
|
6
|
|
|
* Adapter for the Toastr library. |
|
7
|
|
|
* |
|
8
|
|
|
* @package jaxon-dialogs |
|
9
|
|
|
* @author Thierry Feuzeu <[email protected]> |
|
10
|
|
|
* @copyright 2016 Thierry Feuzeu <[email protected]> |
|
11
|
|
|
* @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License |
|
12
|
|
|
* @link https://github.com/jaxon-php/jaxon-dialogs |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
namespace Jaxon\Dialogs\Toastr; |
|
16
|
|
|
|
|
17
|
|
|
use Jaxon\App\Dialog\Library\DialogLibraryTrait; |
|
18
|
|
|
use Jaxon\App\Dialog\Library\MessageTrait; |
|
|
|
|
|
|
19
|
|
|
use Jaxon\App\Dialog\MessageInterface; |
|
20
|
|
|
|
|
21
|
|
|
class ToastrLibrary implements MessageInterface |
|
22
|
|
|
{ |
|
23
|
|
|
use DialogLibraryTrait; |
|
24
|
|
|
use MessageTrait; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @const The library name |
|
28
|
|
|
*/ |
|
29
|
|
|
const NAME = 'toastr'; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @inheritDoc |
|
33
|
|
|
*/ |
|
34
|
|
|
public function getName(): string |
|
35
|
|
|
{ |
|
36
|
|
|
return self::NAME; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @inheritDoc |
|
41
|
|
|
*/ |
|
42
|
|
|
public function getSubdir(): string |
|
43
|
|
|
{ |
|
44
|
|
|
return 'toastr.js'; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @inheritDoc |
|
49
|
|
|
*/ |
|
50
|
|
|
public function getVersion(): string |
|
51
|
|
|
{ |
|
52
|
|
|
return '2.1.3'; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @inheritDoc |
|
57
|
|
|
*/ |
|
58
|
|
|
public function getJs(): string |
|
59
|
|
|
{ |
|
60
|
|
|
return $this->helper()->getJsCode('toastr.min.js'); |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @inheritDoc |
|
65
|
|
|
*/ |
|
66
|
|
|
public function getCss(): string |
|
67
|
|
|
{ |
|
68
|
|
|
return $this->helper()->getCssCode('toastr.min.css'); |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @inheritDoc |
|
73
|
|
|
*/ |
|
74
|
|
|
public function getScript(): string |
|
75
|
|
|
{ |
|
76
|
|
|
return $this->helper()->render('toastr/alert.js'); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* @inheritDoc |
|
81
|
|
|
*/ |
|
82
|
|
|
public function getReadyScript(): string |
|
83
|
|
|
{ |
|
84
|
|
|
return $this->helper()->render('toastr/ready.js.php', [ |
|
85
|
|
|
'options' => $this->helper()->getOptionScript('toastr.options.', 'options.') |
|
86
|
|
|
]); |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* @inheritDoc |
|
91
|
|
|
*/ |
|
92
|
|
|
protected function alert(string $sMessage, string $sTitle, string $sType) |
|
93
|
|
|
{ |
|
94
|
|
|
$this->addCommand('toastr.' . $sType, ['message' => $sMessage, 'title' => $sTitle]); |
|
|
|
|
|
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
public function remove() |
|
98
|
|
|
{ |
|
99
|
|
|
$this->addCommand('toastr.remove'); |
|
|
|
|
|
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
public function clear() |
|
103
|
|
|
{ |
|
104
|
|
|
$this->addCommand('toastr.clear'); |
|
|
|
|
|
|
105
|
|
|
} |
|
106
|
|
|
} |
|
107
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths