Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
14 / 14
88.89% covered (warning)
88.89%
8 / 9
25.00% covered (danger)
25.00%
2 / 8
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ParameterInfo
100.00% covered (success)
100.00%
14 / 14
88.89% covered (warning)
88.89%
8 / 9
25.00% covered (danger)
25.00%
2 / 8
100.00% covered (success)
100.00%
1 / 1
10.75
100.00% covered (success)
100.00%
1 / 1
 info
100.00% covered (success)
100.00%
14 / 14
88.89% covered (warning)
88.89%
8 / 9
25.00% covered (danger)
25.00%
2 / 8
100.00% covered (success)
100.00%
1 / 1
10.75
1<?php
2
3declare(strict_types=1);
4
5namespace Celemas\Wire;
6
7use ReflectionMethod;
8use ReflectionParameter;
9
10final class ParameterInfo
11{
12    public static function info(ReflectionParameter $param): string
13    {
14        $type = $param->getType();
15        $rfn = $param->getDeclaringFunction();
16        $rcls = null;
17
18        if ($rfn instanceof ReflectionMethod) {
19            $rcls = $rfn->getDeclaringClass();
20        }
21
22        return (
23            ($rcls ? $rcls->getName() . '::' : '')
24            . $rfn->getName()
25            . '(..., '
26            . ($type ? (string) $type . ' ' : '')
27            . '$'
28            . $param->getName()
29            . ', ...)'
30        );
31    }
32}

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.

ParameterInfo->info
12    public static function info(ReflectionParameter $param): string
13    {
14        $type = $param->getType();
15        $rfn = $param->getDeclaringFunction();
16        $rcls = null;
17
18        if ($rfn instanceof ReflectionMethod) {
19            $rcls = $rfn->getDeclaringClass();
20        }
21
22        return (
23            ($rcls ? $rcls->getName() . '::' : '')
23            ($rcls ? $rcls->getName() . '::' : '')
23            ($rcls ? $rcls->getName() . '::' : '')
23            ($rcls ? $rcls->getName() . '::' : '')
24            . $rfn->getName()
24            . $rfn->getName()
25            . '(..., '
26            . ($type ? (string) $type . ' ' : '')
26            . ($type ? (string) $type . ' ' : '')
26            . ($type ? (string) $type . ' ' : '')
26            . ($type ? (string) $type . ' ' : '')
27            . '$'
28            . $param->getName()
29            . ', ...)'
30        );
31    }