Passed
Push — main ( 82104f...ee6fb2 )
by Thierry
05:16
created

CssCode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A code() 0 3 1
A files() 0 3 1
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 array $aFiles
22
     */
23
    public function __construct(protected string $sCode = '', protected array $aFiles = [])
24
    {}
25
26
    /**
27
     * Get the CSS code to include into the page
28
     *
29
     * The code must NOT be enclosed in HTML tags.
30
     *
31
     * @return string
32
     */
33
    public function code(): string
34
    {
35
        return $this->sCode;
36
    }
37
38
    /**
39
     * Get the CSS files to include into the page
40
     *
41
     * Each entry can be a string or an array with "uri" and "options".
42
     *
43
     * @return array
44
     */
45
    public function files(): array
46
    {
47
        return $this->aFiles;
48
    }
49
}
50