Skip to content
Snippets Groups Projects
Commit c5ba3e12 authored by David Maus's avatar David Maus
Browse files

Fix types

parent 5f92c705
No related branches found
No related tags found
No related merge requests found
...@@ -114,7 +114,7 @@ class RecordCollection implements Iterator ...@@ -114,7 +114,7 @@ class RecordCollection implements Iterator
*/ */
public function __construct(array $response) public function __construct(array $response)
{ {
$this->response = array_replace_recursive(static::$template, $response); $this->response = (array)array_replace_recursive(static::$template, $response);
$this->offset = $this->response['response']['start']; $this->offset = $this->response['response']['start'];
foreach ($this->response['response']['docs'] as $record) { foreach ($this->response['response']['docs'] as $record) {
$this->add(new Record($record)); $this->add(new Record($record));
...@@ -238,7 +238,7 @@ class RecordCollection implements Iterator ...@@ -238,7 +238,7 @@ class RecordCollection implements Iterator
*/ */
public function getSpellcheck() public function getSpellcheck()
{ {
if (!$this->spellcheck) { if ($this->spellcheck === null) {
$params = isset($this->response['responseHeader']['params']) $params = isset($this->response['responseHeader']['params'])
? $this->response['responseHeader']['params'] : array(); ? $this->response['responseHeader']['params'] : array();
$sq = isset($params['spellcheck.q']) $sq = isset($params['spellcheck.q'])
...@@ -264,11 +264,11 @@ class RecordCollection implements Iterator ...@@ -264,11 +264,11 @@ class RecordCollection implements Iterator
/** /**
* Return SOLR facet information. * Return SOLR facet information.
* *
* @return array * @return Facets
*/ */
public function getFacets() public function getFacets()
{ {
if (!$this->facets) { if ($this->facets === null) {
$this->facets = new Facets($this->response['facet_counts']); $this->facets = new Facets($this->response['facet_counts']);
} }
return $this->facets; return $this->facets;
...@@ -281,7 +281,7 @@ class RecordCollection implements Iterator ...@@ -281,7 +281,7 @@ class RecordCollection implements Iterator
*/ */
public function getGroups() public function getGroups()
{ {
if (is_null($this->groups)) { if ($this->groups === null) {
$this->groups = array(); $this->groups = array();
if (isset($this->response['grouped'])) { if (isset($this->response['grouped'])) {
foreach ($this->response['grouped'] as $field => $group) { foreach ($this->response['grouped'] as $field => $group) {
...@@ -315,4 +315,4 @@ class RecordCollection implements Iterator ...@@ -315,4 +315,4 @@ class RecordCollection implements Iterator
return isset($this->response['highlighting']) return isset($this->response['highlighting'])
? $this->response['highlighting'] : array(); ? $this->response['highlighting'] : array();
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment