Skip to content

Commit 4f10f5a

Browse files
authored
add size method (#14)
1 parent 18ebb48 commit 4f10f5a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/DataStructure/Map.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,10 @@ public function get(mixed $key): mixed;
4343
* @return bool true if the key-value pair was removed, false otherwise
4444
*/
4545
public function remove(mixed $key): bool;
46+
/**
47+
* Returns the number of key-value mappings in the map.
48+
*
49+
* @return int the number of key-value mappings
50+
*/
51+
public function size(): int;
4652
}

0 commit comments

Comments
 (0)