TASK: Fix phpdocs and type hints

This commit is contained in:
Daniel Siepmann 2018-10-27 13:10:59 +02:00
parent 30a34c4f15
commit 2c6521a565
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
12 changed files with 21 additions and 42 deletions

View file

@ -68,7 +68,7 @@ class IndexFactory implements Singleton
*/ */
public function getIndexName(): string public function getIndexName(): string
{ {
return (string)$this->configuration->get('connections.elasticsearch.index'); return $this->configuration->get('connections.elasticsearch.index');
} }
/** /**

View file

@ -50,7 +50,7 @@ class MappingFactory implements Singleton
* @param string $documentType * @param string $documentType
* @return \Elastica\Type\Mapping * @return \Elastica\Type\Mapping
*/ */
public function getMapping(\Elastica\Type $type, $documentType = null): \Elastica\Type\Mapping public function getMapping(\Elastica\Type $type, string $documentType = null): \Elastica\Type\Mapping
{ {
$mapping = new \Elastica\Type\Mapping(); $mapping = new \Elastica\Type\Mapping();
$mapping->setType($type); $mapping->setType($type);

View file

@ -58,6 +58,7 @@ class TcaRelationResolvingProcessor implements ProcessorInterface
* @param array $record * @param array $record
* @param array $configuration * @param array $configuration
* @return array * @return array
* @throws \InvalidArgumentException If _table is not configured.
*/ */
public function processData(array $record, array $configuration): array public function processData(array $record, array $configuration): array
{ {

View file

@ -145,7 +145,7 @@ abstract class AbstractIndexer implements IndexerInterface
/** /**
* @return \Generator * @return \Generator
*/ */
protected function getRecordGenerator() protected function getRecordGenerator(): \Generator
{ {
$offset = 0; $offset = 0;
$limit = $this->getLimit(); $limit = $this->getLimit();

View file

@ -75,7 +75,7 @@ class IndexerFactory implements Singleton
/** /**
* @param string $indexerClass * @param string $indexerClass
* @param string $identifier * @param string $identifier
* @return \Codappix\SearchCore\Domain\Index\IndexerInterface * @return IndexerInterface
* @throws NoMatchingIndexerException * @throws NoMatchingIndexerException
*/ */
protected function buildIndexer(string $indexerClass, string $identifier): IndexerInterface protected function buildIndexer(string $indexerClass, string $identifier): IndexerInterface

View file

@ -2,8 +2,6 @@
namespace Codappix\SearchCore\Domain\Model; namespace Codappix\SearchCore\Domain\Model;
use Codappix\SearchCore\Connection\ResultItemInterface;
/* /*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de> * Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
* *
@ -23,6 +21,8 @@ use Codappix\SearchCore\Connection\ResultItemInterface;
* 02110-1301, USA. * 02110-1301, USA.
*/ */
use Codappix\SearchCore\Connection\ResultItemInterface;
class ResultItem implements ResultItemInterface class ResultItem implements ResultItemInterface
{ {
/** /**

View file

@ -24,6 +24,7 @@ namespace Codappix\SearchCore\Domain\Model;
use Codappix\SearchCore\Connection\ConnectionInterface; use Codappix\SearchCore\Connection\ConnectionInterface;
use Codappix\SearchCore\Connection\FacetRequestInterface; use Codappix\SearchCore\Connection\FacetRequestInterface;
use Codappix\SearchCore\Connection\SearchRequestInterface; use Codappix\SearchCore\Connection\SearchRequestInterface;
use Codappix\SearchCore\Connection\SearchResultInterface;
use Codappix\SearchCore\Domain\Search\SearchService; use Codappix\SearchCore\Domain\Search\SearchService;
use Codappix\SearchCore\Utility\ArrayUtility as CustomArrayUtility; use Codappix\SearchCore\Utility\ArrayUtility as CustomArrayUtility;
use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\ArrayUtility;
@ -158,12 +159,12 @@ class SearchRequest implements SearchRequestInterface
$this->searchService = $searchService; $this->searchService = $searchService;
} }
// Extbase QueryInterface
// Current implementation covers only paginate widget support.
/** /**
* Extbase QueryInterface
* Current implementation covers only paginate widget support.
*
* @param bool $returnRawQueryResult * @param bool $returnRawQueryResult
* @return array|\Codappix\SearchCore\Connection\SearchResultInterface|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface * @return SearchResultInterface
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
*/ */
public function execute($returnRawQueryResult = false) public function execute($returnRawQueryResult = false)
@ -223,7 +224,6 @@ class SearchRequest implements SearchRequestInterface
} }
/** /**
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function getSource() public function getSource()
@ -233,7 +233,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param array $orderings * @param array $orderings
* @return \TYPO3\CMS\Extbase\Persistence\QueryInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function setOrderings(array $orderings) public function setOrderings(array $orderings)
@ -243,7 +242,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint
* @return \TYPO3\CMS\Extbase\Persistence\QueryInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function matching($constraint) public function matching($constraint)
@ -253,7 +251,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param mixed $constraint1 * @param mixed $constraint1
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function logicalAnd($constraint1) public function logicalAnd($constraint1)
@ -263,7 +260,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param mixed $constraint1 * @param mixed $constraint1
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function logicalOr($constraint1) public function logicalOr($constraint1)
@ -273,7 +269,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function logicalNot(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint) public function logicalNot(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint)
@ -285,7 +280,6 @@ class SearchRequest implements SearchRequestInterface
* @param string $propertyName * @param string $propertyName
* @param mixed $operand * @param mixed $operand
* @param bool $caseSensitive * @param bool $caseSensitive
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function equals($propertyName, $operand, $caseSensitive = true) public function equals($propertyName, $operand, $caseSensitive = true)
@ -297,7 +291,6 @@ class SearchRequest implements SearchRequestInterface
* @param string $propertyName * @param string $propertyName
* @param string $operand * @param string $operand
* @param bool $caseSensitive * @param bool $caseSensitive
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function like($propertyName, $operand, $caseSensitive = true) public function like($propertyName, $operand, $caseSensitive = true)
@ -308,7 +301,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param string $propertyName * @param string $propertyName
* @param mixed $operand * @param mixed $operand
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function contains($propertyName, $operand) public function contains($propertyName, $operand)
@ -319,7 +311,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param string $propertyName * @param string $propertyName
* @param mixed $operand * @param mixed $operand
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function in($propertyName, $operand) public function in($propertyName, $operand)
@ -330,7 +321,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param string $propertyName * @param string $propertyName
* @param mixed $operand * @param mixed $operand
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function lessThan($propertyName, $operand) public function lessThan($propertyName, $operand)
@ -341,7 +331,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param string $propertyName * @param string $propertyName
* @param mixed $operand * @param mixed $operand
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function lessThanOrEqual($propertyName, $operand) public function lessThanOrEqual($propertyName, $operand)
@ -352,7 +341,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param string $propertyName * @param string $propertyName
* @param mixed $operand * @param mixed $operand
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function greaterThan($propertyName, $operand) public function greaterThan($propertyName, $operand)
@ -363,7 +351,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param string $propertyName * @param string $propertyName
* @param mixed $operand * @param mixed $operand
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function greaterThanOrEqual($propertyName, $operand) public function greaterThanOrEqual($propertyName, $operand)
@ -372,7 +359,6 @@ class SearchRequest implements SearchRequestInterface
} }
/** /**
* @return string|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function getType() public function getType()
@ -390,7 +376,6 @@ class SearchRequest implements SearchRequestInterface
} }
/** /**
* @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function getQuerySettings() public function getQuerySettings()
@ -399,7 +384,6 @@ class SearchRequest implements SearchRequestInterface
} }
/** /**
* @return integer|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function count() public function count()
@ -408,7 +392,6 @@ class SearchRequest implements SearchRequestInterface
} }
/** /**
* @return array|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function getOrderings() public function getOrderings()
@ -417,7 +400,6 @@ class SearchRequest implements SearchRequestInterface
} }
/** /**
* @return null|\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function getConstraint() public function getConstraint()
@ -427,7 +409,6 @@ class SearchRequest implements SearchRequestInterface
/** /**
* @param string $propertyName * @param string $propertyName
* @return bool|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function isEmpty($propertyName) public function isEmpty($propertyName)
@ -445,7 +426,6 @@ class SearchRequest implements SearchRequestInterface
} }
/** /**
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement|void
* @throws \BadMethodCallException * @throws \BadMethodCallException
*/ */
public function getStatement() public function getStatement()

View file

@ -21,6 +21,7 @@ namespace Codappix\SearchCore\Domain\Model;
* 02110-1301, USA. * 02110-1301, USA.
*/ */
use Codappix\SearchCore\Connection\ResultItemInterface;
use Codappix\SearchCore\Connection\SearchResultInterface; use Codappix\SearchCore\Connection\SearchResultInterface;
/** /**

View file

@ -22,11 +22,12 @@ namespace Codappix\SearchCore\Hook;
*/ */
use Codappix\SearchCore\Configuration\NoConfigurationException; use Codappix\SearchCore\Configuration\NoConfigurationException;
use Codappix\SearchCore\Domain\Index\NoMatchingIndexerException;
use Codappix\SearchCore\Domain\Service\DataHandler as OwnDataHandler; use Codappix\SearchCore\Domain\Service\DataHandler as OwnDataHandler;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\DataHandling\DataHandler as CoreDataHandler; use TYPO3\CMS\Core\DataHandling\DataHandler as CoreDataHandler;
use TYPO3\CMS\Core\Log\Logger;
use TYPO3\CMS\Core\Log\LogManager; use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\Log\Logger;
use TYPO3\CMS\Core\SingletonInterface as Singleton; use TYPO3\CMS\Core\SingletonInterface as Singleton;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManager;
@ -93,7 +94,7 @@ class DataHandler implements Singleton
/** /**
* @param CoreDataHandler $dataHandler * @param CoreDataHandler $dataHandler
* @return void * @return void
* @throws \Codappix\SearchCore\Domain\Index\NoMatchingIndexerException * @throws NoMatchingIndexerException
*/ */
public function processDatamap_afterAllOperations(CoreDataHandler $dataHandler) public function processDatamap_afterAllOperations(CoreDataHandler $dataHandler)
{ {
@ -119,7 +120,7 @@ class DataHandler implements Singleton
* @param array $parameters * @param array $parameters
* @param CoreDataHandler $dataHandler * @param CoreDataHandler $dataHandler
* @return void * @return void
* @throws \Codappix\SearchCore\Domain\Index\NoMatchingIndexerException * @throws NoMatchingIndexerException
*/ */
public function clearCachePostProc(array $parameters, CoreDataHandler $dataHandler) public function clearCachePostProc(array $parameters, CoreDataHandler $dataHandler)
{ {
@ -143,7 +144,7 @@ class DataHandler implements Singleton
* @param string $table * @param string $table
* @param integer $uid * @param integer $uid
* @return bool * @return bool
* @throws \Codappix\SearchCore\Domain\Index\NoMatchingIndexerException * @throws NoMatchingIndexerException
*/ */
protected function processRecord(string $table, int $uid): bool protected function processRecord(string $table, int $uid): bool
{ {

View file

@ -21,6 +21,7 @@ namespace Codappix\SearchCore\Integration\Form\Finisher;
* 02110-1301, USA. * 02110-1301, USA.
*/ */
use Codappix\SearchCore\Domain\Index\NoMatchingIndexerException;
use TYPO3\CMS\Form\Domain\Finishers\AbstractFinisher; use TYPO3\CMS\Form\Domain\Finishers\AbstractFinisher;
use TYPO3\CMS\Form\Domain\Finishers\Exception\FinisherException; use TYPO3\CMS\Form\Domain\Finishers\Exception\FinisherException;
@ -48,9 +49,9 @@ class DataHandlerFinisher extends AbstractFinisher
]; ];
/** /**
* @return null|string|void * @return void
* @throws FinisherException * @throws FinisherException
* @throws \Codappix\SearchCore\Domain\Index\NoMatchingIndexerException * @throws NoMatchingIndexerException
*/ */
protected function executeInternal() protected function executeInternal()
{ {

View file

@ -36,9 +36,6 @@ abstract class AbstractDataHandlerTest extends AbstractFunctionalTestCase
*/ */
protected $subject; protected $subject;
/**
* @throws \Doctrine\DBAL\DBALException
*/
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();

View file

@ -67,8 +67,6 @@ class PagesIndexerTest extends AbstractFunctionalTestCase
* @test * @test
* @dataProvider rootLineDataSets * @dataProvider rootLineDataSets
* @param string $dataSetPath * @param string $dataSetPath
* @throws \Codappix\SearchCore\Domain\Index\NoMatchingIndexerException
* @throws \TYPO3\TestingFramework\Core\Exception
*/ */
public function rootLineIsRespectedDuringIndexing($dataSetPath) public function rootLineIsRespectedDuringIndexing($dataSetPath)
{ {