| Total Complexity | 5 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | abstract class AbstractJsCall extends AbstractCall |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * The constructor. |
||
| 26 | * |
||
| 27 | * @param Closure|null $xExprCb |
||
| 28 | */ |
||
| 29 | protected function __construct(protected ?Closure $xExprCb) |
||
| 30 | {} |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Get the call to add to the expression |
||
| 34 | * |
||
| 35 | * @return Attr|Selector |
||
| 36 | */ |
||
| 37 | abstract protected function _exprCall(): Attr|Selector; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get the json expression |
||
| 41 | * |
||
| 42 | * @return JsExpr |
||
| 43 | */ |
||
| 44 | protected function _expr(): JsExpr |
||
| 45 | { |
||
| 46 | $xJsExpr = new JsExpr($this->_exprCall()); |
||
| 47 | // Apply the callback, if one was defined. |
||
| 48 | $this->xExprCb !== null && ($this->xExprCb)($xJsExpr); |
||
| 49 | return $xJsExpr; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get the value of an attribute of the current object |
||
| 54 | * |
||
| 55 | * @param string $sAttribute |
||
| 56 | * |
||
| 57 | * @return JsExpr |
||
| 58 | */ |
||
| 59 | public function __get(string $sAttribute): JsExpr |
||
| 60 | { |
||
| 61 | return $this->_expr()->__get( $sAttribute); |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Set the value of an attribute of the current object |
||
| 66 | * |
||
| 67 | * @param string $sAttribute |
||
| 68 | * @param mixed $xValue |
||
| 69 | * |
||
| 70 | * @return void |
||
| 71 | */ |
||
| 72 | public function __set(string $sAttribute, $xValue) |
||
| 75 | } |
||
| 76 | } |
||
| 77 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.