1 | <?php |
||
28 | class Graph extends AbstractElement implements GraphInterface { |
||
29 | |||
30 | /** |
||
31 | * Helper to simplify construction of strict graphs. |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | 1 | public static function strict() { |
|
38 | |||
39 | /** |
||
40 | * Generate non-strict graphs by default |
||
41 | * |
||
42 | * @var boolean |
||
43 | */ |
||
44 | public $fStrict = false; |
||
45 | |||
46 | /** |
||
47 | * Generate digraphs by default. |
||
48 | */ |
||
49 | public $fDirected = true; |
||
50 | |||
51 | /** |
||
52 | * @param \Pimple\Container $dic |
||
53 | * @param string $name |
||
54 | * @param array $attributes |
||
55 | */ |
||
56 | 71 | public function __construct(Container $dic, $name = 'G', array $attributes = array()) { |
|
70 | |||
71 | /** |
||
72 | * @param bool|null $directed |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | 33 | public function build($directed = null) { |
|
111 | |||
112 | /** |
||
113 | * Helper for Graph::build(): build attributes. |
||
114 | * |
||
115 | * Unrelated with AbstractElement::buildAttributes(). |
||
116 | * |
||
117 | * @param \Grafizzi\Graph\AttributeInterface[] $attributes |
||
118 | * @param bool $directed |
||
119 | * @param string $childIndent |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | 33 | protected function buildAttributesHelper(array $attributes, $directed, $childIndent) { |
|
133 | |||
134 | /** |
||
135 | * Helper for Graph::build(): build children. |
||
136 | * |
||
137 | * @param \Grafizzi\Graph\AbstractElement[] $children |
||
138 | * @param bool $directed |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | 33 | public function buildChildrenHelper(array $children, $directed) { |
|
150 | |||
151 | 40 | public static function getAllowedChildTypes() { |
|
161 | |||
162 | /** |
||
163 | * @return bool |
||
164 | */ |
||
165 | 71 | public function getDirected() { |
|
169 | |||
170 | /** |
||
171 | * @return string |
||
172 | */ |
||
173 | 71 | public function getType() { |
|
177 | |||
178 | /** |
||
179 | * @param bool $directed |
||
180 | */ |
||
181 | 31 | public function setDirected($directed) { |
|
184 | } |
||
185 |