- /**
- * Registers a finder engine implementation.
- *
- * @param AdapterInterface $adapter An adapter instance
- * @param int $priority Highest is selected first
- *
- * @return $this
- *
- * @deprecated since 2.8, to be removed in 3.0.
- */
- public function addAdapter(AdapterInterface $adapter, $priority = 0)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
-
- $this->initDefaultAdapters();
-
- $this->adapters[$adapter->getName()] = array(
- 'adapter' => $adapter,
- 'priority' => $priority,
- 'selected' => false,
- );
-
- return $this->sortAdapters();
- }
-
- /**
- * Sets the selected adapter to the best one according to the current platform the code is run on.
- *
- * @return $this
- *
- * @deprecated since 2.8, to be removed in 3.0.
- */
- public function useBestAdapter()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
-
- $this->initDefaultAdapters();
-
- $this->resetAdapterSelection();
-
- return $this->sortAdapters();
- }
-
- /**
- * Selects the adapter to use.
- *
- * @param string $name
- *
- * @return $this
- *
- * @throws \InvalidArgumentException
- *
- * @deprecated since 2.8, to be removed in 3.0.
- */
- public function setAdapter($name)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
-
- $this->initDefaultAdapters();
-
- if (!isset($this->adapters[$name])) {
- throw new \InvalidArgumentException(sprintf('Adapter "%s" does not exist.', $name));
- }
-
- $this->resetAdapterSelection();
- $this->adapters[$name]['selected'] = true;
-
- return $this->sortAdapters();
- }
-
- /**
- * Removes all adapters registered in the finder.
- *
- * @return $this
- *
- * @deprecated since 2.8, to be removed in 3.0.
- */
- public function removeAdapters()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
-
- $this->adapters = array();
-
- return $this;
- }
-
- /**
- * Returns registered adapters ordered by priority without extra information.
- *
- * @return AdapterInterface[]
- *
- * @deprecated since 2.8, to be removed in 3.0.
- */
- public function getAdapters()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
-
- $this->initDefaultAdapters();
-
- return array_values(array_map(function (array $adapter) {
- return $adapter['adapter'];
- }, $this->adapters));
- }
-