JxnClass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A _class() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Jaxon\Script;
4
5
/**
6
 * JxnClass.php
7
 *
8
 * Call to a Jaxon registered class.
9
 *
10
 * @package jaxon-core
11
 * @author Thierry Feuzeu
12
 * @copyright 2024 Thierry Feuzeu <[email protected]>
13
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
14
 * @link https://github.com/jaxon-php/jaxon-core
15
 */
16
17
use Jaxon\Plugin\Response\Dialog\DialogCommand;
18
 
19
class JxnClass extends JxnCall
20
{
21
    /**
22
     * @var string
23
     */
24
    protected $sJsObject;
25
26
    /**
27
     * The class constructor
28
     *
29
     * @param DialogCommand $xDialog
30
     * @param string $sJsObject
31
     */
32
    public function __construct(DialogCommand $xDialog, string $sJsObject)
33
    {
34
        parent::__construct($xDialog, $sJsObject . '.');
35
        $this->sJsObject = $sJsObject;
36
    }
37
38
    /**
39
     * Get the js class name
40
     *
41
     * @return string
42
     */
43
    public function _class(): string
44
    {
45
        return $this->sJsObject;
46
    }
47
}
48