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\Range;
3
4use Fdsn\Webservices\Event\Data\Radius;
5
6/**
7 * Data structure to handle Radius range
8 *
9 * @param Radius $min    Min radius
10 * @param Radius $max    Max radius
11 */
12class RadiusRange {
13    private Radius $min;
14    private Radius $max;
15
16    function __construct( Radius $min, Radius $max) {
17        if( $min->value() <= $max->value() ) {
18            $this->min = $min;
19            $this->max = $max;
20        }
21        else{
22            $this->min = $max;
23            $this->max = $min;
24        }
25    }
26
27    function __destruct(){ }
28
29    /**
30     * Returns bounding box coordinates 
31     *
32     * @return string Radius range in [%.2f,%.2f] [min radius, max radius] format
33     */
34    function __toString(){ 
35        return sprintf("[%.2f,%.2f]",
36            $this->min->value(), 
37            $this->max->value()); 
38    }
39
40    /**
41     * Get min radius
42     *
43     * @return Radius  Min radius
44     */
45    public function min():Radius { return $this->min; }
46
47    /**
48     * Get max radius
49     *
50     * @return Radius  Max radius
51     */
52    public function max():Radius { return $this->max; }
53
54} 

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
16    function __construct( Radius $min, Radius $max) {
17        if( $min->value() <= $max->value() ) {
 
17        if( $min->value() <= $max->value() ) {
18            $this->min = $min;
 
25    }
16    function __construct( Radius $min, Radius $max) {
17        if( $min->value() <= $max->value() ) {
 
22            $this->min = $max;
23            $this->max = $min;
24        }
25    }
 
25    }
RadiusRange->__destruct
27    function __destruct(){ }
RadiusRange->__toString
35        return sprintf("[%.2f,%.2f]",
36            $this->min->value(), 
37            $this->max->value()); 
38    }
RadiusRange->max
52    public function max():Radius { return $this->max; }
RadiusRange->min
45    public function min():Radius { return $this->min; }