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

AbstractLibrary::getScript()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * AbstractDialogLibrary.php
5
 *
6
 * Base class for javascript dialog libraries.
7
 *
8
 * @package jaxon-core
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;
16
17
use function Jaxon\Dialogs\dialog;
18
19
abstract class AbstractLibrary
20
{
21
    /**
22
     * The dialog library helper
23
     *
24
     * @var LibraryHelper
25
     */
26
    private $xHelper = null;
27
28
    /**
29
     * Get the library name
30
     *
31
     * @return string
32
     */
33
    abstract public function getName(): string;
34
35
    /**
36
     * Get the helper
37
     *
38
     * @return LibraryHelper
39
     */
40
    public function helper(): LibraryHelper
41
    {
42
        return $this->xHelper ?: $this->xHelper = dialog()->getLibraryHelper($this->getName());
43
    }
44
45
    /**
46
     * Get the library base URI
47
     *
48
     * @return string
49
     */
50
    public function getUri(): string
51
    {
52
        return '';
53
    }
54
55
    /**
56
     * Get the CSS header code and file includes
57
     *
58
     * @return string
59
     */
60
    public function getJs(): string
61
    {
62
        return '';
63
    }
64
65
    /**
66
     * Get the javascript header code and file includes
67
     *
68
     * @return string
69
     */
70
    public function getCss(): string
71
    {
72
        return '';
73
    }
74
75
    /**
76
     * Get the javascript code to be printed into the page
77
     *
78
     * @return string
79
     */
80
    public function getScript(): string
81
    {
82
        return '';
83
    }
84
85
    /**
86
     * Get the javascript code to be executed on page load
87
     *
88
     * @return string
89
     */
90
    public function getReadyScript(): string
91
    {
92
        return '';
93
    }
94
}
95