clean ups
This commit is contained in:
parent
40d3df9f92
commit
cacb40286c
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@ namespace FOS\ElasticaBundle\Configuration;
|
|||
*/
|
||||
class Search
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
public $repositoryClass;
|
||||
|
||||
}
|
||||
|
|
|
@ -91,6 +91,7 @@ class FOSElasticaExtension extends Extension
|
|||
* @param ContainerBuilder $container A ContainerBuilder instance
|
||||
* @param array $clientIdsByName
|
||||
* @param $defaultClientName
|
||||
* @param $serializerConfig
|
||||
* @throws \InvalidArgumentException
|
||||
* @return array
|
||||
*/
|
||||
|
@ -170,6 +171,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, $serializerConfig)
|
||||
{
|
||||
|
|
|
@ -40,5 +40,4 @@ class RepositoryManager extends BaseManager
|
|||
|
||||
return parent::getRepository($realEntityName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -97,6 +97,7 @@ class TransformedFinder implements PaginatedFinderInterface
|
|||
public function createPaginatorAdapter($query)
|
||||
{
|
||||
$query = Query::create($query);
|
||||
|
||||
return new TransformedPaginatorAdapter($this->searchable, $query, $this->transformer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace FOS\ElasticaBundle\Manager;
|
|||
use Doctrine\Common\Annotations\Reader;
|
||||
use FOS\ElasticaBundle\Finder\FinderInterface;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* @author Richard Miller <info@limethinking.co.uk>
|
||||
*
|
||||
|
@ -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']);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,5 +32,4 @@ interface RepositoryManagerInterface
|
|||
* @param string $entityName
|
||||
*/
|
||||
public function getRepository($entityName);
|
||||
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace FOS\ElasticaBundle\Paginator;
|
||||
|
||||
use FOS\ElasticaBundle\Paginator\PartialResultsInterface;
|
||||
|
||||
interface PaginatorAdapterInterface
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace FOS\ElasticaBundle\Paginator;
|
||||
|
||||
use FOS\ElasticaBundle\Paginator\PartialResultsInterface;
|
||||
use Elastica\ResultSet;
|
||||
use Elastica\Result;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace FOS\ElasticaBundle\Paginator;
|
||||
|
||||
use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use FOS\ElasticaBundle\Paginator\TransformedPartialResults;
|
||||
use Elastica\SearchableInterface;
|
||||
use Elastica\Query;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace FOS\ElasticaBundle\Paginator;
|
||||
|
||||
use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use FOS\ElasticaBundle\Paginator\RawPartialResults;
|
||||
use Elastica\ResultSet;
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace FOS\ElasticaBundle\Provider;
|
||||
|
||||
use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
|
||||
use FOS\ElasticaBundle\Provider\ProviderInterface;
|
||||
|
||||
abstract class AbstractProvider implements ProviderInterface
|
||||
{
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace FOS\ElasticaBundle\Provider;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block menu %}
|
||||
<span class="label">
|
||||
<span class="icon"><img src="{{ asset('bundles/foselastica/images/elastica.png') }}" alt="" /></span>
|
||||
<strong>Elastica</strong>
|
||||
<span class="count">
|
||||
<span>{{ collector.querycount }}</span>
|
||||
<span class="label">
|
||||
<span class="icon"><img src="{{ asset('bundles/foselastica/images/elastica.png') }}" alt="" /></span>
|
||||
<strong>Elastica</strong>
|
||||
<span class="count">
|
||||
<span>{{ collector.querycount }}</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
|
|
|
@ -8,9 +8,7 @@ use JMS\Serializer\SerializerInterface;
|
|||
class Callback
|
||||
{
|
||||
protected $serializer;
|
||||
|
||||
protected $groups;
|
||||
|
||||
protected $version;
|
||||
|
||||
public function setSerializer($serializer)
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -156,5 +156,4 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
|
|||
$repository = $manager->getRepository($shortEntityName);
|
||||
$this->assertInstanceOf('FOS\ElasticaBundle\Repository', $repository);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -86,5 +86,4 @@ class ElasticaLoggerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$elasticaLogger->logQuery($path, $method, $data, $time);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -97,5 +97,4 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
|
|||
$manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\MissingRepository');
|
||||
$manager->getRepository('Missing Entity');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -119,5 +119,4 @@ class POPO
|
|||
|
||||
class POPO2 extends POPO
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -149,5 +149,4 @@ class ModelToElasticaAutoTransformer implements ModelToElasticaTransformerInterf
|
|||
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue