Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
IdStruct
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
4
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
 id
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
 isValid
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 Dbmi\Webservice\Quake;
3
4/**
5 * QuakeID Datastructure
6 * 
7 * @param string     $id
8 */
9class IdStruct{
10    private string $id;
11
12    public function __construct( string $id ){
13        if( ! $this->isValid($id) )
14            throw new \InvalidArgumentException("Quake::id not valid");
15        
16        $this->id = $id;
17    }
18
19    /**
20     * Get checked event id
21     * 
22     * @return string event id
23     */
24    public function id():string { return $this->id; }
25
26
27    /**
28     * Check if event id is valid
29     * 
30     * @param string event id
31     * @return bool TRUE if event id is valid, FALSE otherwise
32     */
33    private function isValid(string $id): bool {
34        return preg_match('/\d{6}_\d{4}_\d{3}/', $id);
35    }
36
37}
38?>

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.

IdStruct->__construct
12    public function __construct( string $id ){
13        if( ! $this->isValid($id) )
 
14            throw new \InvalidArgumentException("Quake::id not valid");
12    public function __construct( string $id ){
13        if( ! $this->isValid($id) )
 
16        $this->id = $id;
17    }
IdStruct->id
24    public function id():string { return $this->id; }
IdStruct->isValid
33    private function isValid(string $id): bool {
34        return preg_match('/\d{6}_\d{4}_\d{3}/', $id);
35    }