Skip to content

Commit 204a3fd

Browse files
committed
Add AddressCollection::has predicate
1 parent e918322 commit 204a3fd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Geocoder/Model/AddressCollection.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,17 @@ public function slice($offset, $length = null)
5353
return array_slice($this->addresses, $offset, $length);
5454
}
5555

56+
/**
57+
* @return bool
58+
*/
59+
public function has($index)
60+
{
61+
return isset($this->addresses[$index]);
62+
}
63+
5664
/**
5765
* @return Address
66+
* @throws \OutOfBoundsException
5867
*/
5968
public function get($index)
6069
{

0 commit comments

Comments
 (0)