CS fixes for 3.1

This commit is contained in:
Tim Nagel 2015-03-12 21:45:24 +11:00
parent 345b5d423d
commit 89db88c2a0
20 changed files with 54 additions and 43 deletions

View file

@ -3,7 +3,6 @@
namespace FOS\ElasticaBundle\Command;
use FOS\ElasticaBundle\Event\IndexPopulateEvent;
use FOS\ElasticaBundle\Event\PopulateEvent;
use FOS\ElasticaBundle\Event\TypePopulateEvent;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Helper\DialogHelper;

View file

@ -24,6 +24,7 @@ class ProgressClosureBuilder
* @param string $action
* @param string $index
* @param string $type
*
* @return callable
*/
public function build(OutputInterface $output, $action, $index, $type)
@ -61,6 +62,7 @@ class ProgressClosureBuilder
* @param string $action
* @param string $index
* @param string $type
*
* @return callable
*/
private function buildLegacy(OutputInterface $output, $action, $index, $type)

View file

@ -77,7 +77,7 @@ abstract class AbstractProvider extends BaseAbstractProvider
} else {
try {
$this->objectPersister->insertMany($objects);
} catch(BulkResponseException $e) {
} catch (BulkResponseException $e) {
if ($loggerClosure) {
$loggerClosure($batchSize, $nbObjects, sprintf('<error>%s</error>', $e->getMessage()));
}
@ -109,6 +109,7 @@ abstract class AbstractProvider extends BaseAbstractProvider
* @param int $limit
* @param int $offset
* @param array $lastSlice
*
* @return array
*/
protected function getSlice($queryBuilder, $limit, $offset, $lastSlice)

View file

@ -7,7 +7,7 @@ use FOS\ElasticaBundle\Exception\InvalidArgumentTypeException;
use FOS\ElasticaBundle\Doctrine\SliceFetcherInterface;
/**
* Fetches a slice of objects
* Fetches a slice of objects.
*
* @author Thomas Prelot <tprelot@gmail.com>
*/

View file

@ -7,7 +7,7 @@ use FOS\ElasticaBundle\Exception\InvalidArgumentTypeException;
use FOS\ElasticaBundle\Doctrine\SliceFetcherInterface;
/**
* Fetches a slice of objects
* Fetches a slice of objects.
*
* @author Thomas Prelot <tprelot@gmail.com>
*/
@ -22,7 +22,7 @@ class SliceFetcher implements SliceFetcherInterface
throw new InvalidArgumentTypeException($queryBuilder, 'Doctrine\ORM\QueryBuilder');
}
/**
/*
* An orderBy DQL part is required to avoid feching the same row twice.
* @see http://stackoverflow.com/questions/6314879/does-limit-offset-length-require-order-by-for-pagination
* @see http://www.postgresql.org/docs/current/static/queries-limit.html

View file

@ -3,7 +3,7 @@
namespace FOS\ElasticaBundle\Doctrine;
/**
* Fetches a slice of objects
* Fetches a slice of objects.
*
* @author Thomas Prelot <tprelot@gmail.com>
*/
@ -17,7 +17,8 @@ interface SliceFetcherInterface
* @param integer $offset
* @param array $previousSlice
* @param array $identifierFieldNames
*
* @return array
*/
function fetch($queryBuilder, $limit, $offset, array $previousSlice, array $identifierFieldNames);
public function fetch($queryBuilder, $limit, $offset, array $previousSlice, array $identifierFieldNames);
}

View file

@ -14,7 +14,7 @@ namespace FOS\ElasticaBundle\Event;
use Symfony\Component\EventDispatcher\Event;
/**
* Index Populate Event
* Index Populate Event.
*
* @author Oleg Andreyev <oleg.andreyev@intexsys.lv>
*/

View file

@ -14,7 +14,7 @@ namespace FOS\ElasticaBundle\Event;
use Symfony\Component\EventDispatcher\Event;
/**
* Index ResetEvent
* Index ResetEvent.
*
* @author Oleg Andreyev <oleg.andreyev@intexsys.lv>
*/

View file

@ -14,7 +14,7 @@ namespace FOS\ElasticaBundle\Event;
use Symfony\Component\EventDispatcher\Event;
/**
* Type Populate Event
* Type Populate Event.
*
* @author Oleg Andreyev <oleg.andreyev@intexsys.lv>
*/

View file

@ -14,7 +14,7 @@ namespace FOS\ElasticaBundle\Event;
use Symfony\Component\EventDispatcher\Event;
/**
* Type ResetEvent
* Type ResetEvent.
*
* @author Oleg Andreyev <oleg.andreyev@intexsys.lv>
*/

View file

@ -37,7 +37,7 @@ class FantaPaginatorAdapter implements AdapterInterface
}
/**
* Returns Aggregations
* Returns Aggregations.
*
* @return mixed
*

View file

@ -29,7 +29,7 @@ interface PaginatorAdapterInterface
public function getFacets();
/**
* Returns Aggregations
* Returns Aggregations.
*
* @return mixed
*/

View file

@ -26,7 +26,7 @@ interface PartialResultsInterface
public function getFacets();
/**
* Returns the aggregations
* Returns the aggregations.
*
* @return array
*/

View file

@ -110,9 +110,12 @@ class RawPaginatorAdapter implements PaginatorAdapterInterface
/**
* Returns the number of results.
*
* @param boolean $genuineTotal make the function return the `hits.total`
* value of the search result in all cases, instead of limiting it to the
* `size` request parameter.
* If genuineTotal is provided as true, total hits is returned from the
* hits.total value from the search results instead of just returning
* the requested size.
*
* @param boolean $genuineTotal
*
* @return integer The number of results.
*/
public function getTotalHits($genuineTotal = false)
@ -141,11 +144,12 @@ class RawPaginatorAdapter implements PaginatorAdapterInterface
}
/**
* Returns Aggregations
* Returns Aggregations.
*
* @return mixed
*/
public function getAggregations() {
public function getAggregations()
{
if (!isset($this->aggregations)) {
$this->aggregations = $this->searchable->search($this->query)->getAggregations();
}

View file

@ -71,6 +71,7 @@ interface ObjectPersisterInterface
* If the object persister handles the given object.
*
* @param object $object
*
* @return bool
*/
public function handlesObject($object);

View file

@ -72,6 +72,7 @@ abstract class AbstractProvider implements ProviderInterface
* Get string with RAM usage information (current and peak).
*
* @deprecated To be removed in 4.0
*
* @return string
*/
protected function getMemoryUsage()

View file

@ -59,6 +59,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
* @param string $testQuery
* @param int $testLimit
* @param string $method
*
* @return \FOS\ElasticaBundle\Finder\TransformedFinder|\PHPUnit_Framework_MockObject_MockObject
*/
private function getFinderMock($testQuery, $testLimit = null, $method = 'find')

View file

@ -411,6 +411,7 @@ class ModelToElasticaAutoTransformerTest extends \PHPUnit_Framework_TestCase
/**
* @param null|\Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
*
* @return ModelToElasticaAutoTransformer
*/
private function getTransformer($dispatcher = null)