1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace graphp\graph\types; |
4
|
|
|
|
5
|
|
|
use graphp\graph\AbstractGraph; |
6
|
|
|
use graphp\graph\GraphTypeBuilder; |
7
|
|
|
use graphp\util\SupplierUtil; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Class DefaultDirectedGraph |
11
|
|
|
* |
12
|
|
|
* @package graphp\graph\types |
13
|
|
|
*/ |
14
|
|
|
class DefaultDirectedGraph extends AbstractGraph |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* Create a new default directed 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
|
|
|
public function __construct( |
25
|
|
|
?string $edgeClass = null, |
26
|
|
|
?SupplierInterface $vertexSupplier = null, |
|
|
|
|
27
|
|
|
?SupplierInterface $edgeSupplier = null, |
28
|
|
|
?bool $weighted = null |
29
|
|
|
) { |
30
|
|
|
$builder = new GraphTypeBuilder(); |
31
|
|
|
$graphType = $builder->directed() |
32
|
|
|
->allowSelfLoops(true) |
33
|
|
|
->allowMultipleEdges(false) |
34
|
|
|
->allowCycles(false) |
35
|
|
|
->weighted($weighted) |
36
|
|
|
->build(); |
37
|
|
|
if (!is_null($edgeClass)) { |
38
|
|
|
$util = new SupplierUtil(); |
39
|
|
|
$edgeSupplier = $util->createSupplier($edgeClass); |
40
|
|
|
parent::__construct( |
41
|
|
|
$vertexSupplier, |
42
|
|
|
$edgeSupplier, |
43
|
|
|
$graphType |
44
|
|
|
); |
45
|
|
|
} else { |
46
|
|
|
parent::__construct( |
47
|
|
|
$vertexSupplier, |
48
|
|
|
$edgeSupplier, |
49
|
|
|
$graphType |
50
|
|
|
); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Create a default directed graph builder |
56
|
|
|
* |
57
|
|
|
* @param string $edgeClass - the edge class |
58
|
|
|
* @param SupplierInterface $edgeSupplier - the edge supplier |
59
|
|
|
* |
60
|
|
|
* @return GraphBuilder |
61
|
|
|
*/ |
62
|
|
|
public function createBuilder(?string $edgeClass = null, ?SupplierInterface $edgeSupplier = null): GraphBuilder |
|
|
|
|
63
|
|
|
{ |
64
|
|
|
if (!is_null($edgeClass)) { |
65
|
|
|
return new GraphBuilder(new DefaultDirectedGraph($edgeClass)); |
66
|
|
|
} |
67
|
|
|
return new GraphBuilder(new DefaultDirectedGraph(null, $edgeSupplier)); |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths