Passed
Push — main ( 02d0e2...a48ca0 )
by Thierry
12:44 queued 11:20
created

Alertify::getJs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Alertify.php
5
 *
6
 * Adapter for the Alertify 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\Dialog\Library;
16
17
use Jaxon\Dialogs\Dialog\AbstractLibrary;
18
use Jaxon\App\Dialog\Library\AlertInterface;
19
use Jaxon\App\Dialog\Library\ConfirmInterface;
20
use Jaxon\App\Dialog\Library\ModalInterface;
21
22
class Alertify extends AbstractLibrary implements ModalInterface, AlertInterface, ConfirmInterface
23
{
24
    /**
25
     * @const The library name
26
     */
27
    const NAME = 'alertify';
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function getName(): string
33
    {
34
        return self::NAME;
35
    }
36
37
    /**
38
     * @inheritDoc
39
     */
40
    public function getUri(): string
41
    {
42
        return 'https://cdn.jsdelivr.net/npm/[email protected]/build';
43
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48
    public function getJs(): string
49
    {
50
        return $this->helper()->getJsCode('alertify.min.js');
51
    }
52
53
    /**
54
     * @inheritDoc
55
     */
56
    public function getCss(): string
57
    {
58
        return $this->helper()->getCssCode('css/alertify.min.css') . "\n" .
59
            $this->helper()->getCssCode('css/themes/default.min.css');
60
    }
61
62
    /**
63
     * @inheritDoc
64
     */
65
    public function getReadyScript(): string
66
    {
67
        return $this->helper()->render('alertify.js');
68
    }
69
}
70