Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Call
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
3
1<?php
2
3declare(strict_types=1);
4
5namespace Celemas\Wire;
6
7use Attribute;
8use Celemas\Wire\Exception\WireException;
9
10/** @psalm-api */
11#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
12class Call
13{
14    public array $args;
15
16    public function __construct(
17        public readonly string $method,
18        mixed ...$args,
19    ) {
20        if (count($args) > 0) {
21            if (is_int(array_key_first($args))) {
22                throw new WireException('Arguments for Call must be named arguments');
23            }
24        }
25
26        $this->args = $args;
27    }
28}

Branches

Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once. Please also be aware that some branches may be implicit rather than explicit, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

Call->__construct
17        public readonly string $method,
18        mixed ...$args,
19    ) {
20        if (count($args) > 0) {
21            if (is_int(array_key_first($args))) {
22                throw new WireException('Arguments for Call must be named arguments');
26        $this->args = $args;
27    }