Skip to content

Commit 3a56393

Browse files
committed
Merge branch 'release/0.38.0'
2 parents 6339981 + c860eb6 commit 3a56393

File tree

132 files changed

+3205
-11884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+3205
-11884
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.iml
22
Documentation/_build/
3+
.scannerwork

.sonar-project.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sonar.projectKey=t3events
2+
sonar.organization=dwenzel-github
3+
sonar.sources=.
4+
sonar.exclusions=**/Tests/**,**/Contrib/**,**/.Build/**
5+
sonar.cpd.exclusions=ext_tables.*,**/TCA/**
6+
sonar.typescript.exclusions=**/TypoScript/**,**/TSConfig/**
7+
sonar.php.coverage.reportPaths = .Build/log/coverage/clover.xml
8+
sonar.php.tests.reportPaths = .Build/log/junit.xml
9+

.travis.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,30 @@ sudo: false
55
matrix:
66
fast_finish: true
77
include:
8-
- php: 5.5
9-
env: TYPO3_VERSION=^6.2
10-
- php: 5.6
11-
env: TYPO3_VERSION=^7.6
12-
- php: 7.0
13-
env: TYPO3_VERSION=^7.6 COVERAGE=1
148
- php: 7.0
9+
env: TYPO3_VERSION=^8 COVERAGE=1
10+
- php: 7.2
1511
env: TYPO3_VERSION=^8
16-
allow_failures:
17-
- env: TYPO3_VERSION=^6.2
18-
1912
env:
2013
global:
2114
secure: S8QheEMVpSRsPPIhYQZ4tUCTbxpM7csZ0GydJaPY8p/FAEnZLiH6xcsiTGKOljva5HDelCdBvunaWtUO/+CdKIgsdbQGbqc1aWmG6gr+ShQk4X3KzeAA91AFmkJOR6Jv69lUTm6Uo9AKs1JtuVZsOa1aoOmfApohqFuXsRBNXlg=
15+
jdk:
16+
- oraclejdk8
17+
18+
addons:
19+
sonarcloud:
20+
organisation: dwenzel-github
21+
branches:
22+
- master
23+
- (develop|feature\/|release\/)[-]?.*
2224

2325
cache:
2426
directories:
2527
- $HOME/.composer/cache
28+
- $HOME/.sonar/cache
2629

2730
before_script:
28-
- composer require typo3/cms=$TYPO3_VERSION
31+
- composer require typo3/minimal=$TYPO3_VERSION
2932
- git checkout composer.json
3033
- export TYPO3_PATH_WEB=$PWD/.Build/Web
3134

@@ -41,7 +44,11 @@ script:
4144
if [[ "$COVERAGE" == "1" ]]; then
4245
echo;
4346
echo "Running unit tests";
44-
.Build/bin/phpunit --colors -c Tests/Build/UnitTests.xml Tests/Unit/ --coverage-clover .Build/log/coverage/clover.xml
47+
.Build/bin/phpunit --colors -c Tests/Build/UnitTests.xml Tests/Unit/ \
48+
--coverage-clover .Build/log/coverage/clover.xml \
49+
--log-junit .Build/log/junit.xml
50+
rm -rf .Build/vendor/ .Build/Web/ .Build/bin/
51+
sonar-scanner -Dproject.settings=.sonar-project.properties
4552
fi
4653
4754
after_success:

ChangeLog

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2018-06-01 [RELEASE] Release of t3events 0.38.0 (Dirk Wenzel)
2+
2018-06-01 e31afd2 [TASK] code quality: - invalid usage of deprecated Event/PerformancesViewHelper removed from templates - early return removed from render method (Dirk Wenzel)
3+
2018-06-01 1705ece [TASK] code cleanup (Dirk Wenzel)
4+
2018-06-01 39ed60e [BUGFIX] CI: sonar-section readded. TYPO3 version 9 removed from matrix (Dirk Wenzel)
5+
2018-06-01 978ba52 [TASK] require typo3/cms:8.7.x (next version will not support TYPO3 9 yet) (Dirk Wenzel)
6+
2018-06-01 054017a [BUGFIX] prevent error caused by missing section in template file (Dirk Wenzel)
7+
2018-05-22 bdc71c0 [TASK] invalid and deprecated method calls and configuration options replaced (Dirk Wenzel)
8+
2018-04-13 f435fe4 [TASK] deprecated classes and functions replaced - extbase ArrayUtility by core ArrayUtility - GeneralUtility::requireOnce by require_once (Dirk Wenzel)
9+
2018-04-13 015ce21 [TASK] fixed unit tests - respect strict argument types of count() method (Dirk Wenzel)
10+
2018-04-13 681975d [TASK] fix unit tests - obsolete coverage annotation removed - make sure that 'findDemanded' method returns a mock QueryResult (Dirk Wenzel)
11+
2018-04-13 4ed1cbf [TASK] require typo3/cms-core instead of typo3/cms and use typo3/minimal for travis ci. (Dirk Wenzel)
12+
2018-04-13 6c27966 [TASK] View/ConfigurableViewInterface and Controller/Backend/BackendViewTrait implemented. (Dirk Wenzel)
13+
2018-04-13 3689af7 [TASK] Unit Tests refactored for current version of testing framework. - DemandedRepositoryTrait->generateQuery is now public (Dirk Wenzel)
14+
2018-04-10 ef54b3e [TASK] drop support for TYPO3 version 7.x (Dirk Wenzel)
15+
2018-04-02 9070989 [TASK] allow typo3/cms version 9.x (Dirk Wenzel)
16+
2018-03-11 cf1eb67 [BUGFIX] CI remove build folder before sonar scan. (Dirk Wenzel)
17+
2018-03-11 b9625be [TASK] travis CI: sonar-runner coverage file paths configured, generate junit style log for phpunit (Dirk Wenzel)
18+
2018-03-11 2fbbe4f [TASK] CI configuration for sonar changed: use identifier typescript in properties (Dirk Wenzel)
19+
2018-03-11 073e971 [TASK] CI exclude TypoScript folder from TypeScript sonar check (Dirk Wenzel)
20+
2018-03-11 82e57f2 [TASK] code quality - deprecated <b> tag in HTML templates replaced by - jQuery library removed - duplicate markup moved to partial (Dirk Wenzel)
21+
2018-03-11 12e9103 [TASK] CI: ignore duplication in ext_tables and TCA files. (Dirk Wenzel)
22+
2018-03-11 f48b4f2 [TASK] travis CI: enable some more branches for sonarcloud (Dirk Wenzel)
23+
2018-03-10 66e5ff9 [TASK] travis CI: call sonar-runner with coverage. (Dirk Wenzel)
24+
125
2018-02-05 [RELEASE] Release of t3events 0.37.3 (Dirk Wenzel)
226
2018-01-30 2596c02 [BUGFIX] missing label for plugin form added. (Dirk Wenzel)
327
2017-11-06 cfad7d5 [BUGFIX] fixed error in PeriodConstraintRepositoryTrait where events with past start date and future end date where not selected correctly (when using specific constraint) (Dirk Wenzel)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace DWenzel\T3events\Controller\Backend;
4+
5+
/***************************************************************
6+
* Copyright notice
7+
*
8+
* (c) 2018 Dirk Wenzel <[email protected]>
9+
* All rights reserved
10+
*
11+
* The GNU General Public License can be found at
12+
* http://www.gnu.org/copyleft/gpl.html.
13+
* A copy is found in the text file GPL.txt and important notices to the license
14+
* from the author is found in LICENSE.txt distributed with these scripts.
15+
* This script is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
* This copyright notice MUST APPEAR in all copies of the script!
20+
***************************************************************/
21+
22+
use DWenzel\T3events\View\ConfigurableViewInterface;
23+
use TYPO3\CMS\Backend\View\BackendTemplateView;
24+
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
25+
26+
/**
27+
* Trait BackendViewTrait
28+
* This trait is intended to be used with backend Controllers.
29+
* It initializes a BackendView and Template
30+
*/
31+
trait BackendViewTrait
32+
{
33+
34+
/**
35+
* Settings (from TypoScript for module)
36+
*
37+
* @var array
38+
*/
39+
protected $settings = [];
40+
41+
/**
42+
* @var BackendTemplateView
43+
*/
44+
protected $view;
45+
46+
public function initializeView(ViewInterface $view) {
47+
if (
48+
$view instanceof ConfigurableViewInterface &&
49+
!empty($this->settings[ConfigurableViewInterface::SETTINGS_KEY])
50+
) {
51+
$view->apply($this->settings[ConfigurableViewInterface::SETTINGS_KEY]);
52+
}
53+
}
54+
55+
}

Classes/Controller/SettingsUtilityTrait.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<?php
22
namespace DWenzel\T3events\Controller;
33

4-
use TYPO3\CMS\Extbase\Utility\ArrayUtility;
54
use DWenzel\T3events\Utility\SettingsUtility;
5+
use TYPO3\CMS\Core\Utility\ArrayUtility;
66

77
/**
88
* Class SettingsUtilityTrait
9-
109
*
11-
*@package Controller
10+
* @package Controller
1211
*/
1312
trait SettingsUtilityTrait
1413
{
@@ -51,7 +50,7 @@ public function mergeSettings()
5150
$controllerSettings = $this->settings[$controllerKey];
5251
}
5352
$allowedControllerSettingKeys = ['search', 'notify'];
54-
foreach ($controllerSettings as $key=>$value) {
53+
foreach ($controllerSettings as $key => $value) {
5554
if (!in_array($key, $allowedControllerSettingKeys)) {
5655
unset($controllerSettings[$key]);
5756
}
@@ -60,7 +59,8 @@ public function mergeSettings()
6059
$actionSettings = $this->settings[$controllerKey][$actionName];
6160
}
6261

63-
$typoScriptSettings = ArrayUtility::arrayMergeRecursiveOverrule($controllerSettings, $actionSettings, false, false);
64-
return ArrayUtility::arrayMergeRecursiveOverrule($typoScriptSettings, $this->settings, false, false);
62+
ArrayUtility::mergeRecursiveWithOverrule($controllerSettings, $actionSettings);
63+
ArrayUtility::mergeRecursiveWithOverrule($controllerSettings, $this->settings);
64+
return $controllerSettings;
6565
}
6666
}

Classes/Domain/Repository/CategoryConstraintRepositoryTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ trait CategoryConstraintRepositoryTrait
1919
* @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
2020
* @param \DWenzel\T3events\Domain\Model\Dto\CategoryAwareDemandInterface $demand
2121
* @return array<\TYPO3\CMS\Extbase\Persistence\QOM\Constraint>
22+
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
2223
*/
2324
public function createCategoryConstraints(QueryInterface $query, CategoryAwareDemandInterface $demand)
2425
{

Classes/Domain/Repository/DemandedRepositoryTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function createOrderingsFromDemand(DemandInterface $demand)
113113
* @param bool $respectEnableFields
114114
* @return QueryInterface
115115
*/
116-
protected function generateQuery(DemandInterface $demand, $respectEnableFields = true)
116+
public function generateQuery(DemandInterface $demand, $respectEnableFields = true)
117117
{
118118
$query = $this->createQuery();
119119
$constraints = $this->createConstraintsFromDemand($query, $demand);
@@ -144,7 +144,6 @@ protected function generateQuery(DemandInterface $demand, $respectEnableFields =
144144
$query->setOrderings($orderings);
145145
}
146146

147-
148147
if ($demand->getLimit() !== null) {
149148
$query->setLimit((int)$demand->getLimit());
150149
}
@@ -199,8 +198,9 @@ public function combineConstraints(QueryInterface $query, &$constraints, $additi
199198
* @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
200199
* @param \DWenzel\T3events\Domain\Model\Dto\SearchAwareDemandInterface $demand
201200
* @return array<\TYPO3\CMS\Extbase\Persistence\QOM\Constraint>
201+
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
202202
*/
203-
protected function createSearchConstraints(QueryInterface $query, SearchAwareDemandInterface $demand)
203+
public function createSearchConstraints(QueryInterface $query, SearchAwareDemandInterface $demand)
204204
{
205205
$searchConstraints = [];
206206
if ($search = $demand->getSearch()) {

Classes/Domain/Repository/EventRepository.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ class EventRepository extends AbstractDemandedRepository implements
3434
{
3535
use PeriodConstraintRepositoryTrait, LocationConstraintRepositoryTrait,
3636
AudienceConstraintRepositoryTrait;
37+
3738
/**
3839
* Create category constraints from demand
3940
*
4041
* @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
4142
* @param \DWenzel\T3events\Domain\Model\Dto\EventDemand $demand
4243
* @return array<\TYPO3\CMS\Extbase\Persistence\QOM\Constraint>
44+
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
4345
*/
44-
protected function createCategoryConstraints(QueryInterface $query, $demand)
46+
public function createCategoryConstraints(QueryInterface $query, $demand)
4547
{
4648
// gather OR constraints (categories)
4749
$categoryConstraints = [];

Classes/Utility/EmConfigurationUtility.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ class EmConfigurationUtility
1717
* Gets the settings from extension manager
1818
*
1919
* @return EmConfiguration
20+
* @throws \BadFunctionCallException
2021
*/
21-
public static function getSettings()
22+
public static function getSettings(): EmConfiguration
2223
{
2324
$configuration = self::parseSettings();
24-
GeneralUtility::requireOnce(ExtensionManagementUtility::extPath('t3events') . 'Classes/Domain/Model/Dto/EmConfiguration.php');
25-
$settings = new EmConfiguration($configuration);
26-
return $settings;
25+
require_once ExtensionManagementUtility::extPath('t3events') . 'Classes/Domain/Model/Dto/EmConfiguration.php';
26+
return new EmConfiguration($configuration);
2727
}
2828

2929
/**
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
namespace DWenzel\T3events\View;
3+
4+
/***************************************************************
5+
* Copyright notice
6+
*
7+
* (c) 2018 Dirk Wenzel <[email protected]>
8+
* All rights reserved
9+
*
10+
* The GNU General Public License can be found at
11+
* http://www.gnu.org/copyleft/gpl.html.
12+
* A copy is found in the text file GPL.txt and important notices to the license
13+
* from the author is found in LICENSE.txt distributed with these scripts.
14+
* This script is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
* This copyright notice MUST APPEAR in all copies of the script!
19+
***************************************************************/
20+
21+
22+
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
23+
24+
/**
25+
* Interface ConfigurableViewInterface
26+
*/
27+
interface ConfigurableViewInterface extends ViewInterface
28+
{
29+
const SETTINGS_KEY = 'view';
30+
31+
/**
32+
* Applies a given configuration to the view
33+
*
34+
* @param array $configuration
35+
* @return void
36+
*/
37+
public function apply(array $configuration);
38+
}

Classes/ViewHelpers/Event/PerformancesViewHelper.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function initializeArguments()
6060
parent::registerArgument('event', Event::class, 'Event whose performances should be rendered.', true);
6161
parent::registerArgument('tagName', 'string', 'Tag name to use for enclosing container', false, 'div');
6262
parent::registerArgument('tagNameChildren', 'string', 'Tag name to use for child nodes', false, 'span');
63-
parent::registerArgument('type', 'string', 'Result type: available options are complete, list, dateRange, crucialStatus', true);
63+
parent::registerArgument('type', 'string', 'Result type: available options are: dateRange, crucialStatus', true);
6464
parent::registerArgument('class', 'string', 'Class attribute for enclosing container', false, 'list');
6565
parent::registerArgument('classChildren', 'string', 'Class attribute for children', false, 'single');
6666
parent::registerArgument('classFirst', 'string', 'Class name for first child', false, 'first');
@@ -98,10 +98,6 @@ public function render()
9898
}
9999
}
100100
break;
101-
case 'lowestPrice':
102-
//return raw number to allow using <f:format.currency />
103-
return $this->getLowestPrice();
104-
break;
105101
default:
106102
break;
107103
}

Classes/ViewHelpers/Location/CountViewHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ public function render()
5959
$locationsArray = array_values(array_unique($locationsArray));
6060
}
6161

62-
return count($locationsArray);
62+
return \count($locationsArray);
6363
}
6464
}

0 commit comments

Comments
 (0)