Skip to content

Commit 510c025

Browse files
authored
Merge pull request #134 from kdambekalns/cleanup
TASK: Cleanup codebase, adjust test setup This fixes some code style issues and adjusts the test setup a bit: - removes an unused class and outdated documentation - replaces all file level docblocks with the current style - code style tweaks - disables realtime indexing for Testing context For Travis CI it updates the used Elasticsearch from 1.7.0 to 1.7.5 and adds PHP 7.0 to the matrix.
2 parents 6905f58 + bcf8905 commit 510c025

23 files changed

+372
-514
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
language: php
22
matrix:
33
include:
4+
- php: 7.0
45
- php: 5.6
56
- php: 5.5
67
sudo: false
78
before_install:
89
- cd ..
9-
- wget --no-check-certificate https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.0.zip && unzip elasticsearch-1.7.0.zip
10-
- mv elasticsearch-1.7.0 elasticsearch
10+
- wget --no-check-certificate https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.5.zip && unzip elasticsearch-1.7.5.zip
11+
- mv elasticsearch-1.7.5 elasticsearch
1112
- cd elasticsearch
1213
- bin/elasticsearch -d
1314
- cd ..
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<?php
22
namespace Flowpack\ElasticSearch\ContentRepositoryAdaptor\Client;
33

4-
/* *
5-
* This script belongs to the TYPO3 Flow package "Flowpack.ElasticSearch.ContentRepositoryAdaptor". *
6-
* *
7-
* It is free software; you can redistribute it and/or modify it under *
8-
* the terms of the GNU Lesser General Public License, either version 3 *
9-
* of the License, or (at your option) any later version. *
10-
* *
11-
* The TYPO3 project - inspiring people to share! *
12-
* */
4+
/*
5+
* This file is part of the Flowpack.ElasticSearch.ContentRepositoryAdaptor package.
6+
*
7+
* (c) Contributors of the Neos Project - www.neos.io
8+
*
9+
* This package is Open Source Software. For the full copyright and license
10+
* information, please view the LICENSE file which was distributed with this
11+
* source code.
12+
*/
1313

14+
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\ElasticSearchClient;
15+
use Flowpack\ElasticSearch\Domain\Model\Client;
1416
use TYPO3\Flow\Annotations as Flow;
1517

1618
/**
@@ -29,10 +31,10 @@ class ClientFactory
2931
/**
3032
* Create a client
3133
*
32-
* @return \Flowpack\ElasticSearch\Domain\Model\Client
34+
* @return Client
3335
*/
3436
public function create()
3537
{
36-
return $this->clientFactory->create(null, 'Flowpack\ElasticSearch\ContentRepositoryAdaptor\ElasticSearchClient');
38+
return $this->clientFactory->create(null, ElasticSearchClient::class);
3739
}
3840
}

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Command/NodeIndexCommandController.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?php
22
namespace Flowpack\ElasticSearch\ContentRepositoryAdaptor\Command;
33

4-
/* *
5-
* This script belongs to the TYPO3 Flow package "Flowpack.ElasticSearch.ContentRepositoryAdaptor". *
6-
* *
7-
* It is free software; you can redistribute it and/or modify it under *
8-
* the terms of the GNU Lesser General Public License, either version 3 *
9-
* of the License, or (at your option) any later version. *
10-
* *
11-
* The TYPO3 project - inspiring people to share! *
12-
* */
4+
/*
5+
* This file is part of the Flowpack.ElasticSearch.ContentRepositoryAdaptor package.
6+
*
7+
* (c) Contributors of the Neos Project - www.neos.io
8+
*
9+
* This package is Open Source Software. For the full copyright and license
10+
* information, please view the LICENSE file which was distributed with this
11+
* source code.
12+
*/
1313

14+
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Mapping\NodeTypeMappingBuilder;
1415
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Service\IndexWorkspaceTrait;
1516
use TYPO3\Flow\Annotations as Flow;
1617
use TYPO3\Flow\Cli\CommandController;
17-
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Mapping\NodeTypeMappingBuilder;
1818

1919
/**
2020
* Provides CLI features for index handling
@@ -166,7 +166,7 @@ public function buildCommand($limit = null, $update = false, $workspace = null,
166166
}
167167

168168
$callback = function ($workspaceName, $indexedNodes, $dimensions) {
169-
if ($dimensions === array()) {
169+
if ($dimensions === []) {
170170
$this->outputLine('Workspace "' . $workspaceName . '" without dimensions done. (Indexed ' . $indexedNodes . ' nodes)');
171171
} else {
172172
$this->outputLine('Workspace "' . $workspaceName . '" and dimensions "' . json_encode($dimensions) . '" done. (Indexed ' . $indexedNodes . ' nodes)');

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Command/NodeTypeCommandController.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22
namespace Flowpack\ElasticSearch\ContentRepositoryAdaptor\Command;
33

4-
/* *
5-
* This script belongs to the TYPO3 Flow package "Flowpack.ElasticSearch.ContentRepositoryAdaptor". *
6-
* *
7-
* It is free software; you can redistribute it and/or modify it under *
8-
* the terms of the GNU Lesser General Public License, either version 3 *
9-
* of the License, or (at your option) any later version. *
10-
* *
11-
* The TYPO3 project - inspiring people to share! *
12-
* */
4+
/*
5+
* This file is part of the Flowpack.ElasticSearch.ContentRepositoryAdaptor package.
6+
*
7+
* (c) Contributors of the Neos Project - www.neos.io
8+
*
9+
* This package is Open Source Software. For the full copyright and license
10+
* information, please view the LICENSE file which was distributed with this
11+
* source code.
12+
*/
1313

1414
use TYPO3\Flow\Annotations as Flow;
1515
use TYPO3\Flow\Cli\CommandController;
@@ -43,7 +43,7 @@ public function showCommand($nodeType = null)
4343
$configuration = $nodeType->getFullConfiguration();
4444
} else {
4545
$nodeTypes = $this->nodeTypeManager->getNodeTypes();
46-
$configuration = array();
46+
$configuration = [];
4747
/** @var \TYPO3\TYPO3CR\Domain\Model\NodeType $nodeType */
4848
foreach ($nodeTypes as $nodeTypeName => $nodeType) {
4949
$configuration[$nodeTypeName] = $nodeType->getFullConfiguration();

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Eel/ElasticSearchQuery.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22
namespace Flowpack\ElasticSearch\ContentRepositoryAdaptor\Eel;
33

4-
/* *
5-
* This script belongs to the TYPO3 Flow package "Flowpack.ElasticSearch.ContentRepositoryAdaptor". *
6-
* *
7-
* It is free software; you can redistribute it and/or modify it under *
8-
* the terms of the GNU Lesser General Public License, either version 3 *
9-
* of the License, or (at your option) any later version. *
10-
* *
11-
* The TYPO3 project - inspiring people to share! *
12-
* */
4+
/*
5+
* This file is part of the Flowpack.ElasticSearch.ContentRepositoryAdaptor package.
6+
*
7+
* (c) Contributors of the Neos Project - www.neos.io
8+
*
9+
* This package is Open Source Software. For the full copyright and license
10+
* information, please view the LICENSE file which was distributed with this
11+
* source code.
12+
*/
1313

1414
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception;
1515
use TYPO3\Flow\Persistence\QueryInterface;
@@ -30,6 +30,11 @@ class ElasticSearchQuery implements QueryInterface
3030
*/
3131
protected static $runtimeQueryResultCache;
3232

33+
/**
34+
* ElasticSearchQuery constructor.
35+
*
36+
* @param ElasticSearchQueryBuilder $elasticSearchQueryBuilder
37+
*/
3338
public function __construct(ElasticSearchQueryBuilder $elasticSearchQueryBuilder)
3439
{
3540
$this->queryBuilder = $elasticSearchQueryBuilder;
@@ -46,6 +51,7 @@ public function execute($cacheResult = false)
4651
}
4752
$queryResult = new ElasticSearchQueryResult($this);
4853
self::$runtimeQueryResultCache[$queryHash] = $queryResult;
54+
4955
return $queryResult;
5056
}
5157

0 commit comments

Comments
 (0)