Skip to content

Commit fd18f1f

Browse files
committed
Replace all occurances of Graph::isEmpty()
1 parent d872510 commit fd18f1f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Degree.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function getDegreeMax()
8080
public function isRegular()
8181
{
8282
// an empty graph is considered regular
83-
if ($this->graph->isEmpty()) {
83+
if ($this->graph->getVertices()->isEmpty()) {
8484
return true;
8585
}
8686
try {

src/Tree/BaseDirected.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ public function getVertexRoot()
7373
* checks if this is a tree
7474
*
7575
* @return boolean
76-
* @uses Graph::isEmpty() to skip empty Graphs (an empty Graph is a valid tree)
76+
* @uses Vertices::isEmpty() to skip empty Graphs (an empty Graph is a valid tree)
7777
* @uses self::getVertexRoot() to get root Vertex to start search from
7878
* @uses self::getVerticesSubtree() to count number of vertices connected to root
7979
*/
8080
public function isTree()
8181
{
82-
if ($this->graph->isEmpty()) {
82+
if ($this->graph->getVertices()->isEmpty()) {
8383
return true;
8484
}
8585

src/Tree/Undirected.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ class Undirected extends Tree
4949
* checks if this is a tree
5050
*
5151
* @return boolean
52-
* @uses Graph::isEmpty() to skip empty Graphs (an empty Graph is a valid tree)
52+
* @uses Vertices::isEmpty() to skip empty Graphs (an empty Graph is a valid tree)
5353
* @uses Graph::getVertexFirst() to get get get random "root" Vertex to start search from
5454
* @uses self::getVerticesSubtreeRecursive() to count number of vertices connected to root
5555
*/
5656
public function isTree()
5757
{
58-
if ($this->graph->isEmpty()) {
58+
if ($this->graph->getVertices()->isEmpty()) {
5959
return true;
6060
}
6161

0 commit comments

Comments
 (0)