1 | <?php |
||
16 | class Index |
||
17 | { |
||
18 | /** |
||
19 | * @var LuceneIndex |
||
20 | */ |
||
21 | private static $index; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $path; |
||
27 | |||
28 | /** |
||
29 | * Open |
||
30 | * |
||
31 | * @param bool $path |
||
32 | * @param bool $forceCreate |
||
33 | * @return \ZendSearch\Lucene\SearchIndexInterface |
||
34 | * @throws ExceptionInterface |
||
35 | * @throws \Exception |
||
36 | */ |
||
37 | 4 | public function open($path = false, $forceCreate = true) |
|
44 | |||
45 | /** |
||
46 | * @param integer $limit |
||
47 | * @return $this |
||
48 | */ |
||
49 | 1 | public function limit($limit) |
|
54 | |||
55 | /** |
||
56 | * Index |
||
57 | * |
||
58 | * Extends the Lucene "open" method to create the index if it doesn't exist. |
||
59 | * |
||
60 | * @param string|boolean $path |
||
61 | * @param boolean $forceCreate |
||
62 | * @return SearchIndexInterface |
||
63 | * @throws \Exception |
||
64 | */ |
||
65 | 4 | private function index($path, $forceCreate = true) |
|
79 | |||
80 | /** |
||
81 | * @param $path |
||
82 | */ |
||
83 | 1 | public function setPath($path) |
|
87 | |||
88 | /** |
||
89 | * @return string |
||
90 | * @throws \Exception |
||
91 | */ |
||
92 | 4 | protected function path() |
|
100 | |||
101 | /** |
||
102 | * @return LuceneIndex |
||
103 | */ |
||
104 | 1 | public function get() |
|
108 | } |
||
109 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.