Skip to content

Commit

Permalink
removed dogano/php-util dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
doganoo committed Jun 10, 2018
1 parent 867e156 commit 5f361a2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 31 deletions.
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@
},
"require-dev": {
"phpunit/phpunit": "6.5"
},
"require": {
"doganoo/php-util": "0.0.1"
}
}
5 changes: 2 additions & 3 deletions src/Common/Abstracts/AbstractGraphSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

use doganoo\PHPAlgorithms\Datastructure\Graph\Graph\Node;
use doganoo\PHPAlgorithms\Datastructure\Lists\ArrayLists\ArrayList;
use doganoo\PHPUtil\Log\Logger;

/**
* Class AbstractTraverse
Expand All @@ -44,7 +43,7 @@ abstract class AbstractGraphSearch {
public function __construct() {
$this->visited = new ArrayList();
$this->callable = function ($value) {
Logger::debug($value);
echo $value;
};
}

Expand All @@ -62,7 +61,7 @@ public function visit($value) {
if (null === $this->callable
&& !\is_callable($this->callable)) {
$callable = function ($otherValue) {
Logger::debug($otherValue);
echo $otherValue;
};
}
$callable($value);
Expand Down
3 changes: 1 addition & 2 deletions src/Common/Abstracts/AbstractTraverse.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


use doganoo\PHPAlgorithms\Common\Interfaces\IBinaryNode;
use doganoo\PHPUtil\Log\Logger;

/**
* Class AbstractTraverse
Expand Down Expand Up @@ -57,7 +56,7 @@ public function visit($value) {
if (null === $this->callable
&& !\is_callable($this->callable)) {
$callable = function ($otherValue) {
Logger::debug($otherValue);
echo $otherValue;
};
}
$callable($value);
Expand Down
11 changes: 0 additions & 11 deletions src/Datastructure/Graph/Tree/Heap/MaxHeap.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
namespace doganoo\PHPAlgorithms\Datastructure\Graph\Tree\Heap;

use doganoo\PHPAlgorithms\Common\Util\Comparator;
use doganoo\PHPUtil\Log\Logger;

/**
* Class MaxHeap
Expand Down Expand Up @@ -63,16 +62,6 @@ public function clear(): bool {
return \count($this->heap) === 1 && $this->heap[0] == \PHP_INT_MIN;
}

/**
* displays the heap
*/
public function display() {
for ($i = 1; $i <= $this->length() / 2; $i++) {
$string = "Parent Node: " . $this->heap[$i] . " Left Child: " . $this->heap[2 * $i] . " Right Child: " . $this->heap[2 * $i + 1];
Logger::debug($string);
}
}

/**
* returns the number of elements in the heap
*
Expand Down
12 changes: 0 additions & 12 deletions src/Datastructure/Graph/Tree/Heap/MinHeap.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
namespace doganoo\PHPAlgorithms\Datastructure\Graph\Tree\Heap;

use doganoo\PHPAlgorithms\Common\Util\Comparator;
use doganoo\PHPUtil\Log\Logger;


/**
* Class MinHeap
Expand Down Expand Up @@ -64,16 +62,6 @@ public function clear(): bool {
return \count($this->heap) === 1 && $this->heap[0] === \PHP_INT_MIN;
}

/**
* displays the heap
*/
public function display() {
for ($i = 1; $i <= $this->length() / 2; $i++) {
$string = "Parent Node: " . $this->heap[$i] . " Left Child: " . $this->heap[2 * $i] . " Right Child: " . $this->heap[2 * $i + 1];
Logger::debug($string);
}
}

/**
* returns the number of elements in the heap
*
Expand Down

0 comments on commit 5f361a2

Please sign in to comment.