Skip to content

Commit

Permalink
Ajout de la fonction ->count()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulysse ARNAUD committed Dec 4, 2021
1 parent 723fe03 commit c4d60ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ulyssear/flexible-collections",
"description": "Lightweight & flexible collections for PHP 8",
"type": "library",
"version": "1.2.1",
"version": "1.2.2",
"license": "MIT",
"authors": [
{
Expand Down
3 changes: 3 additions & 0 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ public function __construct(array $map = [])
})
->setFunction('entries', function () {
return $this->map;
})
->setFunction('count', function () {
return count(array_values($this->map));
});
}

Expand Down

0 comments on commit c4d60ba

Please sign in to comment.