Passed
Push — main ( 2ea88b...5eae70 )
by Thierry
04:01
created

CssCode::code()   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
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * CssCode.php
5
 *
6
 * The CSS codes generated by a Jaxon plugin.
7
 *
8
 * @package jaxon-core
9
 * @author Thierry Feuzeu <[email protected]>
10
 * @copyright 2025 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-core
13
 */
14
15
namespace Jaxon\Plugin;
16
17
class CssCode
18
{
19
    /**
20
     * @param string $sCode
21
     * @param string $sHtml
22
     * @param array $aUrls
23
     */
24
    public function __construct(protected string $sCode = '',
25
        protected string $sHtml = '', protected array $aUrls = [])
26
    {}
27
28
    /**
29
     * Get the CSS files to include into the page
30
     *
31
     * Each entry can be a string or an array with "uri" and "options".
32
     *
33
     * @return array
34
     */
35
    public function urls(): array
36
    {
37
        return $this->aUrls;
38
    }
39
40
    /**
41
     * Get the CSS code to include into the page
42
     *
43
     * The code must NOT be enclosed in HTML tags.
44
     *
45
     * @return string
46
     */
47
    public function code(): string
48
    {
49
        return $this->sCode;
50
    }
51
52
    /**
53
     * Get the CSS code to include into the page
54
     *
55
     * The code must be enclosed in HTML tags.
56
     *
57
     * @return string
58
     */
59
    public function html(): string
60
    {
61
        return $this->sHtml;
62
    }
63
}
64