CLENAUP: Remove some scrutinizer ci issues

This commit is contained in:
Daniel Siepmann 2016-12-12 18:02:52 +01:00
parent 62ce197406
commit 1692a02c55
5 changed files with 18 additions and 13 deletions

View file

@ -84,8 +84,8 @@ class Elasticsearch implements Singleton, ConnectionInterface
{ {
$this->withType( $this->withType(
$documentType, $documentType,
function ($type) use($document) { function ($type) use ($document) {
$type->addDocument($this->documentFactory->getDocument($documentType, $document)); $type->addDocument($this->documentFactory->getDocument($type->getName(), $document));
} }
); );
} }
@ -104,8 +104,8 @@ class Elasticsearch implements Singleton, ConnectionInterface
{ {
$this->withType( $this->withType(
$documentType, $documentType,
function ($type) use($documentType) { function ($type) use ($document) {
$type->updateDocument($this->documentFactory->getDocument($documentType, $document)); $type->updateDocument($this->documentFactory->getDocument($type->getName(), $document));
} }
); );
} }
@ -120,8 +120,8 @@ class Elasticsearch implements Singleton, ConnectionInterface
{ {
$this->withType( $this->withType(
$documentType, $documentType,
function ($type) use($documents) { function ($type) use ($documents) {
$type->addDocuments($this->documentFactory->getDocuments($documentType, $documents)); $type->addDocuments($this->documentFactory->getDocuments($type->getName(), $documents));
} }
); );
} }
@ -141,7 +141,7 @@ class Elasticsearch implements Singleton, ConnectionInterface
/** /**
* @param SearchRequestInterface $searchRequest * @param SearchRequestInterface $searchRequest
* @return SearchResultInterface * @return \Elastica\ResultSet
*/ */
public function search(SearchRequestInterface $searchRequest) public function search(SearchRequestInterface $searchRequest)
{ {
@ -151,6 +151,7 @@ class Elasticsearch implements Singleton, ConnectionInterface
$search->addIndex('typo3content'); $search->addIndex('typo3content');
// TODO: Return wrapped result to implement our interface. // TODO: Return wrapped result to implement our interface.
// Also update php doc to reflect the change.
return $search->search($searchRequest->getSearchTerm()); return $search->search($searchRequest->getSearchTerm());
} }

View file

@ -85,6 +85,7 @@ class DataHandler implements Singleton
} }
$this->dataHandler->delete($table, $uid); $this->dataHandler->delete($table, $uid);
return true;
} }
/** /**
@ -123,6 +124,7 @@ class DataHandler implements Singleton
'Database update not processed, cause status is unhandled.', 'Database update not processed, cause status is unhandled.',
[$status, $table, $uid, $fieldArray] [$status, $table, $uid, $fieldArray]
); );
return true;
} }
/** /**
@ -153,7 +155,7 @@ class DataHandler implements Singleton
* *
* @param string $table * @param string $table
* @param int $uid * @param int $uid
* @return null|array * @return null|array<String>
*/ */
protected function getRecord($table, $uid) protected function getRecord($table, $uid)
{ {

View file

@ -27,7 +27,7 @@ use TYPO3\CMS\Core\Tests\FunctionalTestCase as CoreTestCase;
* *
* It will take care of leaving a clean environment for next test. * It will take care of leaving a clean environment for next test.
*/ */
abstract class FunctionalTestCase extends CoreTestCase abstract class AbstractFunctionalTestCase extends CoreTestCase
{ {
protected $testExtensionsToLoad = ['typo3conf/ext/search_core']; protected $testExtensionsToLoad = ['typo3conf/ext/search_core'];
@ -54,7 +54,9 @@ abstract class FunctionalTestCase extends CoreTestCase
public function tearDown() public function tearDown()
{ {
// Delete everything so next test starts clean. // Delete everything so next test starts clean.
if ($this->client) {
$this->client->getIndex('_all')->delete(); $this->client->getIndex('_all')->delete();
$this->client->getIndex('_all')->clearCache(); $this->client->getIndex('_all')->clearCache();
}
} }
} }

View file

@ -21,14 +21,14 @@ namespace Leonmrni\SearchCore\Tests\Functional\Hooks;
*/ */
use Leonmrni\SearchCore\Hook\DataHandler as Hook; use Leonmrni\SearchCore\Hook\DataHandler as Hook;
use Leonmrni\SearchCore\Tests\Functional\FunctionalTestCase; use Leonmrni\SearchCore\Tests\Functional\AbstractFunctionalTestCase;
use TYPO3\CMS\Core\DataHandling\DataHandler as CoreDataHandler; use TYPO3\CMS\Core\DataHandling\DataHandler as CoreDataHandler;
use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManager;
/** /**
* *
*/ */
class DataHandlerTest extends FunctionalTestCase class DataHandlerTest extends AbstractFunctionalTestCase
{ {
public function setUp() public function setUp()
{ {

View file

@ -21,13 +21,13 @@ namespace Leonmrni\SearchCore\Tests\Functional\Indexing;
*/ */
use Leonmrni\SearchCore\Domain\Index\IndexerFactory; use Leonmrni\SearchCore\Domain\Index\IndexerFactory;
use Leonmrni\SearchCore\Tests\Functional\FunctionalTestCase; use Leonmrni\SearchCore\Tests\Functional\AbstractFunctionalTestCase;
use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManager;
/** /**
* *
*/ */
class IndexTcaTableTest extends FunctionalTestCase class IndexTcaTableTest extends AbstractFunctionalTestCase
{ {
public function setUp() public function setUp()
{ {