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

Remove dependency on Symfony components

parent ef528a52
No related branches found
No related tags found
No related merge requests found
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
namespace HAB\Solr\Facet; namespace HAB\Solr\Facet;
use Symfony\Component\HttpFoundation\ParameterBag;
/** /**
* An abstract base class for facet adapters. * An abstract base class for facet adapters.
* *
...@@ -72,7 +70,7 @@ abstract class AbstractFacetAdapter implements FacetAdapterInterface ...@@ -72,7 +70,7 @@ abstract class AbstractFacetAdapter implements FacetAdapterInterface
/** /**
* Application state. * Application state.
* *
* @var ParameterBag * @var array
*/ */
private $state; private $state;
...@@ -188,11 +186,13 @@ abstract class AbstractFacetAdapter implements FacetAdapterInterface ...@@ -188,11 +186,13 @@ abstract class AbstractFacetAdapter implements FacetAdapterInterface
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function setComponentState (ParameterBag $state) public function setComponentState (array $state)
{ {
$params = $state->get('f'); if (array_key_exists('f', $state)) {
if ($params && is_array($params) && isset($params[$this->getName()])) { $params = $state->get('f');
$this->setFilterValues($params[$this->getName()]); if ($params && is_array($params) && isset($params[$this->getName()])) {
$this->setFilterValues($params[$this->getName()]);
}
} }
$this->state = $state; $this->state = $state;
} }
...@@ -227,4 +227,4 @@ abstract class AbstractFacetAdapter implements FacetAdapterInterface ...@@ -227,4 +227,4 @@ abstract class AbstractFacetAdapter implements FacetAdapterInterface
* @return mixed * @return mixed
*/ */
abstract public function getFilterValues (); abstract public function getFilterValues ();
} }
\ No newline at end of file
...@@ -27,8 +27,6 @@ use HAB\Solr\Response\Json\RecordCollection; ...@@ -27,8 +27,6 @@ use HAB\Solr\Response\Json\RecordCollection;
use HAB\Solr\Response\Json\RecordCollectionConsumerInterface; use HAB\Solr\Response\Json\RecordCollectionConsumerInterface;
use HAB\Solr\ParameterProviderInterface; use HAB\Solr\ParameterProviderInterface;
use Symfony\Component\HttpFoundation\ParameterBag;
use Countable; use Countable;
use ArrayIterator; use ArrayIterator;
use IteratorAggregate; use IteratorAggregate;
...@@ -135,7 +133,7 @@ class FacetCollection implements Countable, IteratorAggregate, ParameterProvider ...@@ -135,7 +133,7 @@ class FacetCollection implements Countable, IteratorAggregate, ParameterProvider
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function setComponentState (ParameterBag $state) public function setComponentState (array $state)
{ {
$state = $this->getComponentStateFilter()->filter($state); $state = $this->getComponentStateFilter()->filter($state);
foreach ($this->facets as $facet) { foreach ($this->facets as $facet) {
......
...@@ -39,8 +39,8 @@ class DefaultStateFilter implements StateFilterInterface ...@@ -39,8 +39,8 @@ class DefaultStateFilter implements StateFilterInterface
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function filter (ParameterBag $state) public function filter (array $state)
{ {
return clone($state); return clone($state);
} }
} }
\ No newline at end of file
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
namespace HAB\Solr\Facet\StateFilter; namespace HAB\Solr\Facet\StateFilter;
use Symfony\Component\HttpFoundation\ParameterBag;
/** /**
* Interface of a component state filter. * Interface of a component state filter.
* *
...@@ -37,8 +35,8 @@ interface StateFilterInterface ...@@ -37,8 +35,8 @@ interface StateFilterInterface
/** /**
* Return filtered state. * Return filtered state.
* *
* @param ParameterBag $state * @param array $state
* @return ParameterBag * @return array
*/ */
public function filter (ParameterBag $state); public function filter (array $state);
} }
\ 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