Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
7 / 7
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
Author
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
7 / 7
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%
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
 equals
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 Author
6 *
7 * @param string $name        Name of author
8 */
9class Author {
10    private string $name;
11
12    function __construct(string $name){
13
14        if( empty($name) )
15            throw new \InvalidArgumentException("Author 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 Author name
26     * @return string Catalog name
27     */
28    public function name():string { return $this->name;}
29
30    /**
31     * Compare two objects
32     * @return bool        true are equals, false otherwise
33     */
34    public function equals(self $other):bool{ return $this->name  == $other->name; }
35} 

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.

Author->__construct
12    function __construct(string $name){
13
14        if( empty($name) )
15            throw new \InvalidArgumentException("Author name invalid");
17        $this->name = $name;
18    }
Author->__destruct
20    function __destruct(){ }
Author->__toString
22    function __toString(){ return sprintf("%s", $this->name); }
Author->equals
34    public function equals(self $other):bool{ return $this->name  == $other->name; }
Author->name
28    public function name():string { return $this->name;}