diff --git a/Configuration/TypeConfig.php b/Configuration/TypeConfig.php index 3f1c939..fc9041d 100644 --- a/Configuration/TypeConfig.php +++ b/Configuration/TypeConfig.php @@ -77,6 +77,9 @@ class TypeConfig return $this->getConfig('search_analyzer'); } + /** + * @param string $key + */ private function getConfig($key) { return isset($this->config[$key]) ? diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 552f61b..3c5d18c 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -30,7 +30,7 @@ class Configuration implements ConfigurationInterface /** * Generates the configuration tree. * - * @return \Symfony\Component\Config\Definition\NodeInterface + * @return TreeBuilder */ public function getConfigTreeBuilder() { diff --git a/DependencyInjection/FOSElasticaExtension.php b/DependencyInjection/FOSElasticaExtension.php index cdf109b..804be44 100644 --- a/DependencyInjection/FOSElasticaExtension.php +++ b/DependencyInjection/FOSElasticaExtension.php @@ -82,7 +82,7 @@ class FOSElasticaExtension extends Extension /** * @param array $config * @param ContainerBuilder $container - * @return Configuration|null|\Symfony\Component\Config\Definition\ConfigurationInterface + * @return Configuration */ public function getConfiguration(array $config, ContainerBuilder $container) { @@ -523,7 +523,7 @@ class FOSElasticaExtension extends Extension * * @param array $typeConfig * @param ContainerBuilder $container - * @param $elasticaToModelId + * @param string $elasticaToModelId * @param Reference $typeRef * @param string $indexName * @param string $typeName diff --git a/Doctrine/Listener.php b/Doctrine/Listener.php index 73a271d..bd8b2c0 100644 --- a/Doctrine/Listener.php +++ b/Doctrine/Listener.php @@ -174,27 +174,30 @@ class Listener implements EventSubscriber } /** - * Iterate through scheduled actions before flushing to emulate 2.x behavior. Note that the ElasticSearch index - * will fall out of sync with the source data in the event of a crash during flush. + * Iterate through scheduled actions before flushing to emulate 2.x behavior. + * Note that the ElasticSearch index will fall out of sync with the source + * data in the event of a crash during flush. + * + * This method is only called in legacy configurations of the listener. */ - public function preFlush(EventArgs $eventArgs) + public function preFlush() { $this->persistScheduled(); } /** - * Iterating through scheduled actions *after* flushing ensures that the ElasticSearch index will be affected - * only if the query is successful + * Iterating through scheduled actions *after* flushing ensures that the + * ElasticSearch index will be affected only if the query is successful. */ - public function postFlush(EventArgs $eventArgs) + public function postFlush() { $this->persistScheduled(); } /** * Record the specified identifier to delete. Do not need to entire object. - * @param mixed $object - * @return mixed + * + * @param object $object */ protected function scheduleForDeletion($object) { diff --git a/Doctrine/ORM/Provider.php b/Doctrine/ORM/Provider.php index dfd6700..7e2ac12 100644 --- a/Doctrine/ORM/Provider.php +++ b/Doctrine/ORM/Provider.php @@ -3,7 +3,6 @@ namespace FOS\ElasticaBundle\Doctrine\ORM; use Doctrine\ORM\QueryBuilder; -use Elastica\Exception\Bulk\ResponseException as BulkResponseException; use FOS\ElasticaBundle\Doctrine\AbstractProvider; use FOS\ElasticaBundle\Exception\InvalidArgumentTypeException; diff --git a/Elastica/Index.php b/Elastica/Index.php index bf37c51..49c656e 100644 --- a/Elastica/Index.php +++ b/Elastica/Index.php @@ -3,7 +3,6 @@ namespace FOS\ElasticaBundle\Elastica; use Elastica\Index as BaseIndex; -use Elastica\Type; /** * Overridden Elastica Index class that provides dynamic index name changes. @@ -32,6 +31,9 @@ class Index extends BaseIndex return $this->originalName ?: $this->_name; } + /** + * @param string $type + */ public function getType($type) { if (isset($this->typeCache[$type])) { diff --git a/Index/Resetter.php b/Index/Resetter.php index c93ae2d..9b65a8f 100644 --- a/Index/Resetter.php +++ b/Index/Resetter.php @@ -5,9 +5,7 @@ namespace FOS\ElasticaBundle\Index; use Elastica\Index; use Elastica\Exception\ResponseException; use Elastica\Type\Mapping; -use FOS\ElasticaBundle\Configuration\IndexConfig; use FOS\ElasticaBundle\Configuration\ConfigManager; -use FOS\ElasticaBundle\Elastica\Client; /** * Deletes and recreates indexes @@ -110,7 +108,7 @@ class Resetter /** * A command run when a population has finished. * - * @param $indexName + * @param string $indexName */ public function postPopulate($indexName) { diff --git a/Manager/RepositoryManager.php b/Manager/RepositoryManager.php index be07b42..7697b58 100644 --- a/Manager/RepositoryManager.php +++ b/Manager/RepositoryManager.php @@ -69,6 +69,9 @@ class RepositoryManager implements RepositoryManagerInterface return 'FOS\ElasticaBundle\Repository'; } + /** + * @param string $entityName + */ private function createRepository($entityName) { if (!class_exists($repositoryName = $this->getRepositoryName($entityName))) { diff --git a/Paginator/RawPaginatorAdapter.php b/Paginator/RawPaginatorAdapter.php index 9136bc0..f05205a 100644 --- a/Paginator/RawPaginatorAdapter.php +++ b/Paginator/RawPaginatorAdapter.php @@ -54,8 +54,8 @@ class RawPaginatorAdapter implements PaginatorAdapterInterface /** * Returns the paginated results. * - * @param $offset - * @param $itemCountPerPage + * @param integer $offset + * @param integer $itemCountPerPage * @throws \InvalidArgumentException * @return ResultSet */ diff --git a/Persister/ObjectPersister.php b/Persister/ObjectPersister.php index 9604f7e..0fe40c3 100644 --- a/Persister/ObjectPersister.php +++ b/Persister/ObjectPersister.php @@ -4,7 +4,6 @@ namespace FOS\ElasticaBundle\Persister; use Psr\Log\LoggerInterface; use Elastica\Exception\BulkException; -use Elastica\Exception\NotFoundException; use FOS\ElasticaBundle\Transformer\ModelToElasticaTransformerInterface; use Elastica\Type; use Elastica\Document; diff --git a/Persister/ObjectSerializerPersister.php b/Persister/ObjectSerializerPersister.php index 1a15656..3e33f8d 100644 --- a/Persister/ObjectSerializerPersister.php +++ b/Persister/ObjectSerializerPersister.php @@ -17,6 +17,9 @@ class ObjectSerializerPersister extends ObjectPersister { protected $serializer; + /** + * @param string $objectClass + */ public function __construct(Type $type, ModelToElasticaTransformerInterface $transformer, $objectClass, $serializer) { parent::__construct($type, $transformer, $objectClass, array()); diff --git a/Propel/ElasticaToModelTransformer.php b/Propel/ElasticaToModelTransformer.php index af5f8ab..e3602e5 100644 --- a/Propel/ElasticaToModelTransformer.php +++ b/Propel/ElasticaToModelTransformer.php @@ -170,6 +170,7 @@ class ElasticaToModelTransformer implements ElasticaToModelTransformerInterface /** * @see https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Util/Inflector.php + * @param string $str */ private function camelize($str) { diff --git a/Repository.php b/Repository.php index 70b2a21..fcc2784 100644 --- a/Repository.php +++ b/Repository.php @@ -19,21 +19,43 @@ class Repository $this->finder = $finder; } + /** + * @param mixed $query + * @param integer $limit + * @param array $options + * @return array + */ public function find($query, $limit = null, $options = array()) { return $this->finder->find($query, $limit, $options); } + /** + * @param mixed $query + * @param integer $limit + * @param array $options + * @return mixed + */ public function findHybrid($query, $limit = null, $options = array()) { return $this->finder->findHybrid($query, $limit, $options); } + /** + * @param mixed $query + * @param array $options + * @return \Pagerfanta\Pagerfanta + */ public function findPaginated($query, $options = array()) { return $this->finder->findPaginated($query, $options); } + /** + * @param string $query + * @param array $options + * @return Paginator\PaginatorAdapterInterface + */ public function createPaginatorAdapter($query, $options = array()) { return $this->finder->createPaginatorAdapter($query, $options); diff --git a/Tests/Doctrine/AbstractListenerTest.php b/Tests/Doctrine/AbstractListenerTest.php index 1f238d6..7242255 100644 --- a/Tests/Doctrine/AbstractListenerTest.php +++ b/Tests/Doctrine/AbstractListenerTest.php @@ -173,8 +173,14 @@ abstract class ListenerTest extends \PHPUnit_Framework_TestCase abstract protected function getListenerClass(); + /** + * @return string + */ abstract protected function getObjectManagerClass(); + /** + * @return string + */ abstract protected function getClassMetadataClass(); private function createLifecycleEventArgs() @@ -205,6 +211,11 @@ abstract class ListenerTest extends \PHPUnit_Framework_TestCase ->getMock(); } + /** + * @param Listener\Entity $object + * @param string $indexName + * @param string $typeName + */ private function getMockPersister($object, $indexName, $typeName) { $mock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersister') @@ -235,6 +246,12 @@ abstract class ListenerTest extends \PHPUnit_Framework_TestCase return $mock; } + /** + * @param string $indexName + * @param string $typeName + * @param Listener\Entity $object + * @param boolean $return + */ private function getMockIndexable($indexName, $typeName, $object, $return = null) { $mock = $this->getMock('FOS\ElasticaBundle\Provider\IndexableInterface'); @@ -256,6 +273,9 @@ class Entity { private $id; + /** + * @param integer $id + */ public function __construct($id) { $this->id = $id; diff --git a/Tests/FOSElasticaBundleTest.php b/Tests/FOSElasticaBundleTest.php index 3828e8b..4290e1d 100644 --- a/Tests/FOSElasticaBundleTest.php +++ b/Tests/FOSElasticaBundleTest.php @@ -3,7 +3,6 @@ namespace FOS\ElasticaBundle\Tests\Resetter; use FOS\ElasticaBundle\FOSElasticaBundle; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; class FOSElasticaBundleTest extends \PHPUnit_Framework_TestCase { diff --git a/Tests/Persister/ObjectSerializerPersisterTest.php b/Tests/Persister/ObjectSerializerPersisterTest.php index fe15c0c..914b5dd 100644 --- a/Tests/Persister/ObjectSerializerPersisterTest.php +++ b/Tests/Persister/ObjectSerializerPersisterTest.php @@ -2,9 +2,7 @@ namespace FOS\ElasticaBundle\Tests\ObjectSerializerPersister; -use FOS\ElasticaBundle\Persister\ObjectPersister; use FOS\ElasticaBundle\Persister\ObjectSerializerPersister; -use FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer; use FOS\ElasticaBundle\Transformer\ModelToElasticaIdentifierTransformer; use Symfony\Component\PropertyAccess\PropertyAccess; diff --git a/Tests/Transformer/ElasticaToModelTransformerCollectionTest.php b/Tests/Transformer/ElasticaToModelTransformerCollectionTest.php index eb4d8e4..c3fc323 100644 --- a/Tests/Transformer/ElasticaToModelTransformerCollectionTest.php +++ b/Tests/Transformer/ElasticaToModelTransformerCollectionTest.php @@ -157,6 +157,9 @@ class POPO public $id; public $data; + /** + * @param integer $id + */ public function __construct($id, $data) { $this->data = $data;