-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added the IteratorAggregate interface
- Loading branch information
1 parent
be0c538
commit c4092a9
Showing
2 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* @author Patrick Schur <[email protected]> | ||
* @package LanguageDetection | ||
*/ | ||
class LanguageResult implements \JsonSerializable | ||
class LanguageResult implements \JsonSerializable, \IteratorAggregate | ||
{ | ||
private $result = []; | ||
|
||
|
@@ -60,11 +60,19 @@ public function blacklist(string ...$blacklist): LanguageResult | |
/** | ||
* @return array | ||
*/ | ||
public function all(): array | ||
public function close(): array | ||
{ | ||
return $this->result; | ||
} | ||
|
||
/** | ||
* @return \ArrayIterator | ||
*/ | ||
public function getIterator() | ||
{ | ||
return new \ArrayIterator($this->result); | ||
} | ||
|
||
/** | ||
* @param int $offset | ||
* @param int|null $length | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters