Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
5 / 5
CRAP
100.00% covered (success)
100.00%
1 / 1
RadiusRange
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
5 / 5
6
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
 __destruct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __toString
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 min
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 max
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Fdsn\Webservices\Event\Structs;
3
4/**
5 * Data structure to handle Radius range
6 *
7 * @param Radius $min    Min radius
8 * @param Radius $max    Max radius
9 */
10class RadiusRange {
11    private Radius $min;
12    private Radius $max;
13
14    function __construct( Radius $min, Radius $max) {
15        if( $min->value() <= $max->value() ) {
16            $this->min = $min;
17            $this->max = $max;
18        }
19        else{
20            $this->min = $max;
21            $this->max = $min;
22        }
23    }
24
25    function __destruct(){ }
26
27    /**
28     * Returns bounding box coordinates 
29     *
30     * @return string Radius range in [%.2f,%.2f] [min radius, max radius] format
31     */
32    function __toString(){ 
33        return sprintf("[%.2f,%.2f]",
34            $this->min->value(), 
35            $this->max->value()); 
36    }
37
38    /**
39     * Get min radius
40     *
41     * @return Radius  Min radius
42     */
43    public function min():Radius { return $this->min; }
44
45    /**
46     * Get max radius
47     *
48     * @return Radius  Max radius
49     */
50    public function max():Radius { return $this->max; }
51
52} 

Paths

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

RadiusRange->__construct
14    function __construct( Radius $min, Radius $max) {
15        if( $min->value() <= $max->value() ) {
 
15        if( $min->value() <= $max->value() ) {
16            $this->min = $min;
 
23    }
14    function __construct( Radius $min, Radius $max) {
15        if( $min->value() <= $max->value() ) {
 
20            $this->min = $max;
21            $this->max = $min;
22        }
23    }
 
23    }
RadiusRange->__destruct
25    function __destruct(){ }
RadiusRange->__toString
33        return sprintf("[%.2f,%.2f]",
34            $this->min->value(), 
35            $this->max->value()); 
36    }
RadiusRange->max
50    public function max():Radius { return $this->max; }
RadiusRange->min
43    public function min():Radius { return $this->min; }