Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
Struct
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
4 / 4
5
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
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%
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
 name
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\Catalog;
3
4/**
5 * Data structure to handle Catalog
6 *
7 * @param string $name        Name of catalog
8 */
9class Struct {
10    private string $name;
11
12    function __construct(string $name){
13
14        if( empty($name) )
15            throw new \InvalidArgumentException("Catalog name invalid");
16
17        $this->name = $name;
18    }
19
20    function __destruct(){ }
21
22    function __toString(){ return sprintf("%s", $this->name); }
23
24    /**
25     * Get Catalog name
26     * 
27     * @return string Catalog name
28     */
29    public function name():string { return $this->name;}
30} 

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.

Struct->__construct
12    function __construct(string $name){
13
14        if( empty($name) )
15            throw new \InvalidArgumentException("Catalog name invalid");
17        $this->name = $name;
18    }
Struct->__destruct
20    function __destruct(){ }
Struct->__toString
22    function __toString(){ return sprintf("%s", $this->name); }
Struct->name
29    public function name():string { return $this->name;}