@@ 47-57 (lines=11) @@ | ||
44 | * |
|
45 | * @param Closure $callback |
|
46 | */ |
|
47 | public function map(Closure $callback) |
|
48 | { |
|
49 | for ($i = 0; $i < 100; ++$i) { |
|
50 | $segment = $this->path.'/'.sprintf($this->segmentName, $i); |
|
51 | ||
52 | if (file_exists($segment)) { |
|
53 | $dictionary = (array) include $segment; |
|
54 | $callback($dictionary); |
|
55 | } |
|
56 | } |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * Load surname dict. |
@@ 30-39 (lines=10) @@ | ||
27 | * |
|
28 | * @param string $path |
|
29 | */ |
|
30 | public function __construct($path) |
|
31 | { |
|
32 | parent::__construct($path); |
|
33 | for ($i = 0; $i < 100; ++$i) { |
|
34 | $segment = $this->path . '/' . sprintf($this->segmentName, $i); |
|
35 | if (file_exists($segment)) { |
|
36 | $this->segments[] = (array) include $segment; |
|
37 | } |
|
38 | } |
|
39 | } |
|
40 | ||
41 | /** |
|
42 | * Load dict. |