DialogLibraryTrait   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 94
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 8
eloc 10
dl 0
loc 94
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getCss() 0 3 1
A getSubdir() 0 3 1
A getUri() 0 3 1
A getScript() 0 3 1
A getJs() 0 3 1
A getVersion() 0 3 1
A getReadyScript() 0 3 1
A helper() 0 3 1
1
<?php
2
3
/**
4
 * DialogLibraryTrait.php
5
 *
6
 * Common functions 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\Plugin\Response\Dialog\Library;
16
17
trait DialogLibraryTrait
18
{
19
    /**
20
     * The dialog library helper
21
     *
22
     * @var DialogLibraryHelper
23
     */
24
    protected $xHelper;
25
26
    /**
27
     * Get the library name
28
     *
29
     * @return string
30
     */
31
    abstract public function getName(): string;
32
33
    /**
34
     * Get the helper
35
     *
36
     * @return DialogLibraryHelper
37
     */
38
    public function helper(): DialogLibraryHelper
39
    {
40
        return $this->xHelper;
41
    }
42
43
    /**
44
     * Get the library base URI
45
     *
46
     * @return string
47
     */
48
    public function getUri(): string
49
    {
50
        return '';
51
    }
52
53
    /**
54
     * Get the library subdir for the URI
55
     *
56
     * @return string
57
     */
58
    public function getSubdir(): string
59
    {
60
        return '';
61
    }
62
63
    /**
64
     * Get the library version for the URI
65
     *
66
     * @return string
67
     */
68
    public function getVersion(): string
69
    {
70
        return '';
71
    }
72
73
    /**
74
     * Get the CSS header code and file includes
75
     *
76
     * @return string
77
     */
78
    public function getJs(): string
79
    {
80
        return '';
81
    }
82
83
    /**
84
     * Get the javascript header code and file includes
85
     *
86
     * @return string
87
     */
88
    public function getCss(): string
89
    {
90
        return '';
91
    }
92
93
    /**
94
     * Get the javascript code to be printed into the page
95
     *
96
     * @return string
97
     */
98
    public function getScript(): string
99
    {
100
        return '';
101
    }
102
103
    /**
104
     * Get the javascript code to be executed on page load
105
     *
106
     * @return string
107
     */
108
    public function getReadyScript(): string
109
    {
110
        return '';
111
    }
112
}
113