diff --git a/Command/PopulateCommand.php b/Command/PopulateCommand.php index 58e5e9f..7297523 100755 --- a/Command/PopulateCommand.php +++ b/Command/PopulateCommand.php @@ -4,11 +4,9 @@ namespace FOS\ElasticaBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Helper\DialogHelper; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; use FOS\ElasticaBundle\IndexManager; use FOS\ElasticaBundle\Provider\ProviderRegistry; use FOS\ElasticaBundle\Resetter; diff --git a/Command/ResetCommand.php b/Command/ResetCommand.php index b318827..280f9aa 100755 --- a/Command/ResetCommand.php +++ b/Command/ResetCommand.php @@ -3,11 +3,9 @@ namespace FOS\ElasticaBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; use FOS\ElasticaBundle\IndexManager; use FOS\ElasticaBundle\Resetter; diff --git a/Command/SearchCommand.php b/Command/SearchCommand.php index 62e3340..ec7cfb7 100644 --- a/Command/SearchCommand.php +++ b/Command/SearchCommand.php @@ -7,7 +7,6 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; use Elastica\Query; use Elastica\Result; diff --git a/Configuration/Search.php b/Configuration/Search.php index ded65a5..cee10ab 100644 --- a/Configuration/Search.php +++ b/Configuration/Search.php @@ -11,8 +11,6 @@ namespace FOS\ElasticaBundle\Configuration; */ class Search { - /** @var string */ public $repositoryClass; - } diff --git a/DependencyInjection/FOSElasticaExtension.php b/DependencyInjection/FOSElasticaExtension.php index 5b533aa..5ff966e 100644 --- a/DependencyInjection/FOSElasticaExtension.php +++ b/DependencyInjection/FOSElasticaExtension.php @@ -92,6 +92,7 @@ class FOSElasticaExtension extends Extension * @param ContainerBuilder $container A ContainerBuilder instance * @param array $clientIdsByName * @param $defaultClientName + * @param $serializerConfig * @throws \InvalidArgumentException * @return array */ @@ -171,6 +172,7 @@ class FOSElasticaExtension extends Extension * @param $indexName * @param $indexId * @param array $typePrototypeConfig + * @param $serializerConfig */ protected function loadTypes(array $types, ContainerBuilder $container, $indexName, $indexId, array $typePrototypeConfig) { diff --git a/Doctrine/RepositoryManager.php b/Doctrine/RepositoryManager.php index 6ba6bf5..f8867eb 100644 --- a/Doctrine/RepositoryManager.php +++ b/Doctrine/RepositoryManager.php @@ -40,5 +40,4 @@ class RepositoryManager extends BaseManager return parent::getRepository($realEntityName); } - } diff --git a/Finder/TransformedFinder.php b/Finder/TransformedFinder.php index 24f680f..4c8aa98 100644 --- a/Finder/TransformedFinder.php +++ b/Finder/TransformedFinder.php @@ -97,6 +97,7 @@ class TransformedFinder implements PaginatedFinderInterface public function createPaginatorAdapter($query) { $query = Query::create($query); + return new TransformedPaginatorAdapter($this->searchable, $query, $this->transformer); } } diff --git a/Manager/RepositoryManager.php b/Manager/RepositoryManager.php index 6459c19..3cf8e96 100644 --- a/Manager/RepositoryManager.php +++ b/Manager/RepositoryManager.php @@ -5,6 +5,7 @@ namespace FOS\ElasticaBundle\Manager; use Doctrine\Common\Annotations\Reader; use FOS\ElasticaBundle\Finder\FinderInterface; use RuntimeException; + /** * @author Richard Miller * @@ -70,11 +71,10 @@ class RepositoryManager implements RepositoryManagerInterface private function createRepository($entityName) { - $repositoryName = $this->getRepositoryName($entityName); - if (!class_exists($repositoryName)) { + if (!class_exists($repositoryName = $this->getRepositoryName($entityName))) { throw new RuntimeException(sprintf('%s repository for %s does not exist', $repositoryName, $entityName)); } + return new $repositoryName($this->entities[$entityName]['finder']); } - } diff --git a/Manager/RepositoryManagerInterface.php b/Manager/RepositoryManagerInterface.php index c831d35..1008371 100644 --- a/Manager/RepositoryManagerInterface.php +++ b/Manager/RepositoryManagerInterface.php @@ -32,5 +32,4 @@ interface RepositoryManagerInterface * @param string $entityName */ public function getRepository($entityName); - } diff --git a/Paginator/FantaPaginatorAdapter.php b/Paginator/FantaPaginatorAdapter.php index a2f8c0e..2ad6983 100644 --- a/Paginator/FantaPaginatorAdapter.php +++ b/Paginator/FantaPaginatorAdapter.php @@ -3,14 +3,13 @@ namespace FOS\ElasticaBundle\Paginator; use Pagerfanta\Adapter\AdapterInterface; -use FOS\ElasticaBundle\Paginator\PaginatorAdapterInterface; class FantaPaginatorAdapter implements AdapterInterface { private $adapter; /** - * @param PaginatorAdapterInterface $adapter + * @param \FOS\ElasticaBundle\Paginator\PaginatorAdapterInterface $adapter */ public function __construct(PaginatorAdapterInterface $adapter) { @@ -42,7 +41,7 @@ class FantaPaginatorAdapter implements AdapterInterface } /** - * Returns an slice of the results. + * Returns a slice of the results. * * @param integer $offset The offset. * @param integer $length The length. diff --git a/Paginator/PaginatorAdapterInterface.php b/Paginator/PaginatorAdapterInterface.php index 9182973..25786a0 100644 --- a/Paginator/PaginatorAdapterInterface.php +++ b/Paginator/PaginatorAdapterInterface.php @@ -2,8 +2,6 @@ namespace FOS\ElasticaBundle\Paginator; -use FOS\ElasticaBundle\Paginator\PartialResultsInterface; - interface PaginatorAdapterInterface { /** diff --git a/Paginator/RawPaginatorAdapter.php b/Paginator/RawPaginatorAdapter.php index 125cd35..d4b5357 100644 --- a/Paginator/RawPaginatorAdapter.php +++ b/Paginator/RawPaginatorAdapter.php @@ -5,9 +5,6 @@ namespace FOS\ElasticaBundle\Paginator; use Elastica\SearchableInterface; use Elastica\Query; use Elastica\ResultSet; -use FOS\ElasticaBundle\Paginator\PaginatorAdapterInterface; -use FOS\ElasticaBundle\Paginator\RawPartialResults; -use FOS\ElasticaBundle\Paginator\PartialResultsInterface; use InvalidArgumentException; /** @@ -52,6 +49,7 @@ class RawPaginatorAdapter implements PaginatorAdapterInterface * * @param $offset * @param $itemCountPerPage + * @throws \InvalidArgumentException * @return ResultSet */ protected function getElasticaResults($offset, $itemCountPerPage) diff --git a/Paginator/RawPartialResults.php b/Paginator/RawPartialResults.php index 270e4cd..a4afb00 100644 --- a/Paginator/RawPartialResults.php +++ b/Paginator/RawPartialResults.php @@ -2,7 +2,6 @@ namespace FOS\ElasticaBundle\Paginator; -use FOS\ElasticaBundle\Paginator\PartialResultsInterface; use Elastica\ResultSet; use Elastica\Result; diff --git a/Paginator/TransformedPaginatorAdapter.php b/Paginator/TransformedPaginatorAdapter.php index a668636..7bc038a 100644 --- a/Paginator/TransformedPaginatorAdapter.php +++ b/Paginator/TransformedPaginatorAdapter.php @@ -3,7 +3,6 @@ namespace FOS\ElasticaBundle\Paginator; use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface; -use FOS\ElasticaBundle\Paginator\TransformedPartialResults; use Elastica\SearchableInterface; use Elastica\Query; diff --git a/Paginator/TransformedPartialResults.php b/Paginator/TransformedPartialResults.php index f7f125a..13d716c 100644 --- a/Paginator/TransformedPartialResults.php +++ b/Paginator/TransformedPartialResults.php @@ -3,7 +3,6 @@ namespace FOS\ElasticaBundle\Paginator; use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface; -use FOS\ElasticaBundle\Paginator\RawPartialResults; use Elastica\ResultSet; /** diff --git a/Provider/AbstractProvider.php b/Provider/AbstractProvider.php index daa57ae..06883a3 100644 --- a/Provider/AbstractProvider.php +++ b/Provider/AbstractProvider.php @@ -3,7 +3,6 @@ namespace FOS\ElasticaBundle\Provider; use FOS\ElasticaBundle\Persister\ObjectPersisterInterface; -use FOS\ElasticaBundle\Provider\ProviderInterface; abstract class AbstractProvider implements ProviderInterface { diff --git a/Provider/ProviderRegistry.php b/Provider/ProviderRegistry.php index ed5b499..2142223 100644 --- a/Provider/ProviderRegistry.php +++ b/Provider/ProviderRegistry.php @@ -2,8 +2,6 @@ namespace FOS\ElasticaBundle\Provider; -use Symfony\Component\DependencyInjection\ContainerBuilder; - use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/Resources/views/Collector/elastica.html.twig b/Resources/views/Collector/elastica.html.twig index 5da6048..0eb50a6 100644 --- a/Resources/views/Collector/elastica.html.twig +++ b/Resources/views/Collector/elastica.html.twig @@ -19,13 +19,13 @@ {% endblock %} {% block menu %} - - - Elastica - - {{ collector.querycount }} + + + Elastica + + {{ collector.querycount }} + - {% endblock %} {% block panel %} diff --git a/Serializer/Callback.php b/Serializer/Callback.php index 50307e0..9fe7064 100644 --- a/Serializer/Callback.php +++ b/Serializer/Callback.php @@ -8,9 +8,7 @@ use JMS\Serializer\SerializerInterface; class Callback { protected $serializer; - protected $groups; - protected $version; public function setSerializer($serializer) diff --git a/Tests/DataCollector/ElasticaDataCollectorTest.php b/Tests/DataCollector/ElasticaDataCollectorTest.php index 758e1c2..aac1fb4 100644 --- a/Tests/DataCollector/ElasticaDataCollectorTest.php +++ b/Tests/DataCollector/ElasticaDataCollectorTest.php @@ -9,7 +9,6 @@ use FOS\ElasticaBundle\DataCollector\ElasticaDataCollector; */ class ElasticaDataCollectorTest extends \PHPUnit_Framework_TestCase { - public function testCorrectAmountOfQueries() { /** @var $requestMock \PHPUnit_Framework_MockObject_MockObject|\Symfony\Component\HttpFoundation\Request */ @@ -93,5 +92,4 @@ class ElasticaDataCollectorTest extends \PHPUnit_Framework_TestCase $elasticaDataCollector->collect($requestMock, $responseMock); $this->assertEquals(30, $elasticaDataCollector->getTime()); } - } diff --git a/Tests/Doctrine/RepositoryManagerTest.php b/Tests/Doctrine/RepositoryManagerTest.php index 2863127..ce7b14b 100644 --- a/Tests/Doctrine/RepositoryManagerTest.php +++ b/Tests/Doctrine/RepositoryManagerTest.php @@ -156,5 +156,4 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase $repository = $manager->getRepository($shortEntityName); $this->assertInstanceOf('FOS\ElasticaBundle\Repository', $repository); } - } diff --git a/Tests/Logger/ElasticaLoggerTest.php b/Tests/Logger/ElasticaLoggerTest.php index 18eb44b..05624cc 100644 --- a/Tests/Logger/ElasticaLoggerTest.php +++ b/Tests/Logger/ElasticaLoggerTest.php @@ -87,5 +87,4 @@ class ElasticaLoggerTest extends \PHPUnit_Framework_TestCase $elasticaLogger->logQuery($path, $method, $data, $time); } - } diff --git a/Tests/Manager/RepositoryManagerTest.php b/Tests/Manager/RepositoryManagerTest.php index 8cdf1b4..8849035 100644 --- a/Tests/Manager/RepositoryManagerTest.php +++ b/Tests/Manager/RepositoryManagerTest.php @@ -97,5 +97,4 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase $manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\MissingRepository'); $manager->getRepository('Missing Entity'); } - } diff --git a/Tests/RepositoryTest.php b/Tests/RepositoryTest.php index ded8009..6eabe7b 100644 --- a/Tests/RepositoryTest.php +++ b/Tests/RepositoryTest.php @@ -9,7 +9,6 @@ use FOS\ElasticaBundle\Repository; */ class RepositoryTest extends \PHPUnit_Framework_TestCase { - public function testThatFindCallsFindOnFinder() { $testQuery = 'Test Query'; @@ -75,5 +74,4 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase $repository = new Repository($finderMock); $repository->findHybrid($testQuery, $testLimit); } - } diff --git a/Tests/Transformer/ElasticaToModelTransformerCollectionTest.php b/Tests/Transformer/ElasticaToModelTransformerCollectionTest.php index 9b1d782..d33708e 100644 --- a/Tests/Transformer/ElasticaToModelTransformerCollectionTest.php +++ b/Tests/Transformer/ElasticaToModelTransformerCollectionTest.php @@ -119,5 +119,4 @@ class POPO class POPO2 extends POPO { - } diff --git a/Transformer/ModelToElasticaAutoTransformer.php b/Transformer/ModelToElasticaAutoTransformer.php index ecddacf..3107d0a 100644 --- a/Transformer/ModelToElasticaAutoTransformer.php +++ b/Transformer/ModelToElasticaAutoTransformer.php @@ -149,5 +149,4 @@ class ModelToElasticaAutoTransformer implements ModelToElasticaTransformerInterf return $value; } - }