Skip to content

Commit 8a413e7

Browse files
committed
bugfix
1 parent eeb6665 commit 8a413e7

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/Datastructure/Maps/HashMap.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function addNode(Node $node): bool {
9191
* @param $key
9292
* @param $value
9393
* @return bool
94-
* @throws \ReflectionException
9594
* @throws \doganoo\PHPAlgorithms\Common\Exception\InvalidKeyTypeException
9695
* @throws \doganoo\PHPAlgorithms\Common\Exception\UnsupportedKeyTypeException
9796
*/
@@ -109,7 +108,7 @@ public function add($key, $value): bool {
109108
* Notice that contains() looks for the value, not
110109
* key as below.
111110
*/
112-
if ($list->containsValue($value)) {
111+
if ($list->containsKey($key)) {
113112
return true;
114113
}
115114
$list->add($key, $value);

src/Datastructure/Sets/HashSet.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public function addAll($elements): bool {
6767
*
6868
* @param $element
6969
* @return bool
70-
* @throws \ReflectionException
7170
* @throws \doganoo\PHPAlgorithms\common\Exception\InvalidKeyTypeException
7271
* @throws \doganoo\PHPAlgorithms\common\Exception\UnsupportedKeyTypeException
7372
*/

0 commit comments

Comments
 (0)