AbstractCall::__call()   A
last analyzed

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 2
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * AbstractCall.php
5
 *
6
 * Base class for js calls and selectors.
7
 *
8
 * @package jaxon-core
9
 * @author Thierry Feuzeu <[email protected]>
10
 * @copyright 2024 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\Script;
16
17
use Jaxon\Plugin\Response\Dialog\DialogCommand;
18
19
abstract class AbstractCall
20
{
21
    /**
22
     * @var DialogCommand
23
     */
24
    protected $xDialog;
25
26
    /**
27
     * Create a js expression
28
     *
29
     * @return JsExpr
30
     */
31
    abstract protected function _expr(): JsExpr;
32
33
    /**
34
     * Add a call to a js function on the current object
35
     *
36
     * @param string  $sMethod
37
     * @param array  $aArguments
38
     *
39
     * @return JsExpr
40
     */
41
    public function __call(string $sMethod, array $aArguments): JsExpr
42
    {
43
        return $this->_expr()->__call($sMethod, $aArguments);
44
    }
45
}
46