Completed
Push — master ( 044c87...663c3d )
by Bingo
04:35
created

SimpleDirectedWeightedGraph   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 63.64%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 9
dl 0
loc 37
ccs 7
cts 11
cp 0.6364
rs 10
c 1
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createBuilder() 0 6 2
A __construct() 0 10 1
1
<?php
2
3
namespace graphp\graph\types;
4
5
use graphp\graph\AbstractGraph;
6
use graphp\graph\builder\GraphTypeBuilder;
7
use graphp\util\SupplierUtil;
8
9
/**
10
 * Class SimpleDirectedWeightedGraph
11
 *
12
 * @package graphp\graph\types
13
 */
14
class SimpleDirectedWeightedGraph extends SimpleDirectedGraph
15
{
16
    /**
17
     * Create a new simple directed weighted graph
18
     *
19
     * @param string $edgeClass - the edge class
20
     * @param SupplierInterface $vertexSupplier - the vertex supplier
21
     * @param SupplierInterface $edgeSupplier - the edge supplier
22
     * @param bool $weighted - if the graph is weighted
23
     */
24 5
    public function __construct(
25
        ?string $edgeClass = null,
26
        ?SupplierInterface $vertexSupplier = null,
0 ignored issues
show
Bug introduced by
The type graphp\graph\types\SupplierInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
        ?SupplierInterface $edgeSupplier = null
28
    ) {
29 5
        parent::__construct(
30 5
            $edgeClass,
31 5
            $vertexSupplier,
32 5
            $edgeSupplier,
33 5
            true
34
        );
35 5
    }
36
37
    /**
38
     * Create a simple directed weighted graph builder
39
     *
40
     * @param string $edgeClass - the edge class
41
     * @param SupplierInterface $edgeSupplier - the edge supplier
42
     *
43
     * @return GraphBuilder
44
     */
45
    public function createBuilder(?string $edgeClass = null, ?SupplierInterface $edgeSupplier = null): GraphBuilder
0 ignored issues
show
Bug introduced by
The type graphp\graph\types\GraphBuilder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
46
    {
47
        if (!is_null($edgeClass)) {
48
            return new GraphBuilder(new SimpleDirectedWeightedGraph($edgeClass));
49
        }
50
        return new GraphBuilder(new SimpleDirectedWeightedGraph(null, $edgeSupplier));
51
    }
52
}
53