1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* NotyLibrary.php |
5
|
|
|
* |
6
|
|
|
* Adapter for the Noty 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\Noty; |
16
|
|
|
|
17
|
|
|
use Jaxon\App\Dialog\Library\DialogLibraryTrait; |
18
|
|
|
use Jaxon\App\Dialog\Library\MessageTrait; |
|
|
|
|
19
|
|
|
use Jaxon\App\Dialog\Library\QuestionTrait; |
|
|
|
|
20
|
|
|
use Jaxon\App\Dialog\MessageInterface; |
21
|
|
|
use Jaxon\App\Dialog\QuestionInterface; |
22
|
|
|
|
23
|
|
|
class NotyLibrary implements MessageInterface, QuestionInterface |
24
|
|
|
{ |
25
|
|
|
use DialogLibraryTrait; |
26
|
|
|
use MessageTrait; |
27
|
|
|
use QuestionTrait; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @const The library name |
31
|
|
|
*/ |
32
|
|
|
const NAME = 'noty'; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @inheritDoc |
36
|
|
|
*/ |
37
|
|
|
public function getName(): string |
38
|
|
|
{ |
39
|
|
|
return self::NAME; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @inheritDoc |
44
|
|
|
*/ |
45
|
|
|
public function getSubdir(): string |
46
|
|
|
{ |
47
|
|
|
return 'noty'; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @inheritDoc |
52
|
|
|
*/ |
53
|
|
|
public function getVersion(): string |
54
|
|
|
{ |
55
|
|
|
return '2.3.11'; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @inheritDoc |
60
|
|
|
*/ |
61
|
|
|
public function getJs(): string |
62
|
|
|
{ |
63
|
|
|
return $this->helper()->getJsCode('jquery.noty.packaged.min.js'); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @inheritDoc |
68
|
|
|
*/ |
69
|
|
|
public function getScript(): string |
70
|
|
|
{ |
71
|
|
|
return $this->helper()->render('noty/alert.js'); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @inheritDoc |
76
|
|
|
*/ |
77
|
|
|
public function getReadyScript(): string |
78
|
|
|
{ |
79
|
|
|
return $this->helper()->render('noty/ready.js.php'); |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @inheritDoc |
84
|
|
|
*/ |
85
|
|
|
protected function alert(string $sMessage, string $sTitle, string $sStdType) |
86
|
|
|
{ |
87
|
|
|
$aTypes = [ |
88
|
|
|
'info' => 'information', |
89
|
|
|
]; |
90
|
|
|
$sType = $aTypes[$sStdType] ?? $sStdType; |
91
|
|
|
$this->addCommand('noty.alert', ['text' => $sMessage, 'type' => $sType]); |
|
|
|
|
92
|
|
|
} |
93
|
|
|
} |
94
|
|
|
|
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