Skip to content

Commit

Permalink
Add ability to get the total number of items in the data store
Browse files Browse the repository at this point in the history
  • Loading branch information
wpscholar committed Jan 6, 2022
1 parent 5792fa4 commit ba6f669
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions includes/DataStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ class DataStore {
*/
protected $data = [];

/**
* Get the total number of items in the data store.
*
* @return int
*/
public function count() {
return count( $this->data );
}

/**
* Delete a value by key.
*
Expand Down

0 comments on commit ba6f669

Please sign in to comment.