Skip to content

Commit e4cd4de

Browse files
committed
[BUGFIX] Make Extension Compatible to TYPO3 v10.4 and v11.5
Resolves: #83
1 parent 5f9dede commit e4cd4de

File tree

66 files changed

+797
-847
lines changed

Some content is hidden

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

66 files changed

+797
-847
lines changed

.gitlab-ci.yml

Lines changed: 68 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,24 @@ before_script:
2020
stages:
2121
- lint
2222
- test
23+
- documentation
2324
- analysis
2425

2526
lint:cgl:
26-
image: composer:1.6
27+
image: composer:2
2728
stage: lint
2829
before_script:
30+
- composer config platform.php 7.4
2931
- composer remove typo3/cms-core --no-update
3032
- composer install --no-progress --no-ansi --no-interaction
3133
script:
32-
- .build/bin/php-cs-fixer fix --config=Build/.php_cs.dist -v --dry-run --using-cache=no --path-mode=intersection ./
34+
- .build/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --using-cache=no --path-mode=intersection ./
3335

3436
lint:typoscriptcgl:
3537
stage: lint
36-
image: composer:1.6
38+
image: composer:2
3739
script:
40+
- composer config platform.php 7.4
3841
- composer remove typo3/cms-core --no-update
3942
- composer install --no-progress --no-ansi --no-interaction
4043
- .build/bin/typoscript-lint -c Build/typoscriptlint.yaml Configuration
@@ -45,7 +48,7 @@ lint:yaml:
4548
before_script:
4649
- pip install yamllint==1.10.0
4750
script:
48-
- yamllint -c Build/yamllint.yaml Configuration/ Resources/ .travis.yml
51+
- yamllint -c Build/yamllint.yaml Configuration/ Resources/
4952

5053
lint:php72:
5154
stage: lint
@@ -65,6 +68,18 @@ lint:php74:
6568
script:
6669
- find . -name \*.php -exec php -l "{}" \;
6770

71+
lint:php80:
72+
stage: lint
73+
image: php:8.0-alpine
74+
script:
75+
- find . -name \*.php -exec php -l "{}" \;
76+
77+
lint:php81:
78+
stage: lint
79+
image: php:8.1-alpine
80+
script:
81+
- find . -name \*.php -exec php -l "{}" \;
82+
6883
.test: &test_php
6984
stage: test
7085
services:
@@ -104,30 +119,68 @@ lint:php74:
104119
expire_in: 1 day
105120
when: always
106121

107-
# Build in PHP 7.2 and TYPO3 9.5
108-
test:php72:typo3_9:
122+
# Build in PHP 7.2 and TYPO3 10.4
123+
test:php72:typo3_10:
109124
<<: *test_php
110125
variables:
111126
DOCKER_TAG: 7.2-alpine
112-
TYPO3_VERSION: ^9.5
127+
TYPO3_VERSION: ^10.4
113128
COVERAGE: 0
114129

115-
# Build in PHP 7.3 and TYPO3 9.5
116-
test:php73:typo3_9:
130+
# Build in PHP 7.3 and TYPO3 10.4
131+
test:php73:typo3_10:
117132
<<: *test_php
118133
variables:
119134
DOCKER_TAG: 7.3-alpine
120-
TYPO3_VERSION: ^9.5
135+
TYPO3_VERSION: ^10.4
121136
COVERAGE: 0
122137

123-
# Build in PHP 7.4 and TYPO3 9.5
124-
test:php74:typo3_9:
138+
# Build in PHP 7.4 and TYPO3 10.4
139+
test:php74:typo3_10:
125140
<<: *test_php
126141
variables:
127142
DOCKER_TAG: 7.4-alpine
128-
TYPO3_VERSION: ^9.5
143+
TYPO3_VERSION: ^10.4
144+
COVERAGE: 0
145+
146+
test:php74:typo3_11:
147+
<<: *test_php
148+
variables:
149+
DOCKER_TAG: 7.4-alpine
150+
TYPO3_VERSION: ^11.5
151+
COVERAGE: 0
152+
153+
test:php80:typo3_11:
154+
<<: *test_php
155+
variables:
156+
DOCKER_TAG: 8.0-alpine
157+
TYPO3_VERSION: ^11.5
158+
COVERAGE: 0
159+
160+
test:php81:typo3_11:
161+
<<: *test_php
162+
variables:
163+
DOCKER_TAG: 8.1-alpine
164+
TYPO3_VERSION: ^11.5
129165
COVERAGE: 1
130166

167+
documentation:
168+
stage: documentation
169+
image:
170+
name: t3docs/render-documentation:v2.4.0
171+
entrypoint: [""]
172+
before_script:
173+
- cp -a ${CI_PROJECT_DIR}/. /PROJECT
174+
- mkdir -p ${CI_PROJECT_DIR}/Documentation-GENERATED-temp
175+
script:
176+
- cd /ALL/venv
177+
- /ALL/Menu/mainmenu.sh makehtml-no-cache -c resultdir ${CI_PROJECT_DIR}/Documentation-GENERATED-temp
178+
artifacts:
179+
paths:
180+
- ${CI_PROJECT_DIR}/Documentation-GENERATED-temp/Result/project/0.0.0
181+
expire_in: 1 day
182+
when: always
183+
131184
sonarqube:
132185
stage: analysis
133186
image: ciricihq/gitlab-sonar-scanner
@@ -140,7 +193,7 @@ sonarqube:
140193
SONAR_SOURCES: "./Classes"
141194
SONAR_GITLAB_PROJECT_ID: "$CI_PROJECT_ID"
142195
script:
143-
- echo "sonar.projectKey=contacts-3.x" > sonar-project.properties
196+
- echo "sonar.projectKey=contacts-4.x" > sonar-project.properties
144197
- gitlab-sonar-scanner -Dsonar.php.coverage.reportPath=phpunit.coverage.xml -Dsonar.php.tests.reportPath=phpunit.report.xml
145198
allow_failure: true
146199

@@ -155,5 +208,5 @@ sonarqube-reports:
155208
SONAR_ANALYSIS_MODE: "publish"
156209
SONAR_SOURCES: "./Classes"
157210
script:
158-
- echo "sonar.projectKey=contacts-3.x" > sonar-project.properties
211+
- echo "sonar.projectKey=contacts-4.x" > sonar-project.properties
159212
- gitlab-sonar-scanner -Dsonar.php.coverage.reportPath=phpunit.coverage.xml -Dsonar.php.tests.reportPath=phpunit.report.xml

.travis.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
die('This script supports command line usage only. Please check your command.');
55
}
66

7-
return PhpCsFixer\Config::create()
7+
$finder = PhpCsFixer\Finder::create()
8+
->in(__DIR__ . '/../');
9+
10+
$config = new PhpCsFixer\Config();
11+
$config
812
->setRiskyAllowed(true)
913
->setRules([
1014
'@PSR2' => true,
@@ -17,14 +21,14 @@
1721
'ordered_imports' => true,
1822
'single_quote' => true,
1923
'no_empty_statement' => true,
20-
'no_extra_consecutive_blank_lines' => true,
24+
'no_extra_blank_lines' => true,
2125
'phpdoc_no_package' => true,
2226
'phpdoc_scalar' => true,
2327
'no_blank_lines_after_phpdoc' => true,
2428
'array_syntax' => ['syntax' => 'short'],
2529
'whitespace_after_comma_in_array' => true,
2630
'function_typehint_space' => true,
27-
'hash_to_slash_comment' => true,
31+
'single_line_comment_style' => true,
2832
'no_alias_functions' => true,
2933
'lowercase_cast' => true,
3034
'no_leading_namespace_whitespace' => true,
@@ -35,13 +39,7 @@
3539
'phpdoc_no_empty_return' => true,
3640
'phpdoc_trim' => true
3741
])
38-
->setFinder(
39-
PhpCsFixer\Finder::create()
40-
->in(__DIR__ . '/../')
41-
->exclude('.Build')
42-
->exclude('Documentation')
43-
->exclude('Resources')
44-
->notName('ext_emconf.php')
45-
->notName('ext_localconf.php')
46-
->notName('ext_tables.php')
47-
);
42+
->setUsingCache(false)
43+
->setFinder($finder);
44+
45+
return $config;

Classes/Command/GeocodeCommand.php

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
use Symfony\Component\Console\Helper\ProgressBar;
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
16+
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
1617
use TYPO3\CMS\Core\Database\ConnectionPool;
1718
use TYPO3\CMS\Core\Utility\GeneralUtility;
1819

1920
class GeocodeCommand extends Command
2021
{
21-
2222
/**
2323
* @var string
2424
*/
@@ -29,31 +29,23 @@ class GeocodeCommand extends Command
2929
*/
3030
protected $googleMapsApiKey = '';
3131

32-
protected function configure()
32+
protected function configure(): void
3333
{
3434
$this->setDescription('Geocode addresses of contact extension');
3535
$this->setHelp('Try to geocode all addresses of contact extension, where latitude and longitude are not set. It uses the google maps API. A valid API key is required!');
3636
}
3737

38-
/**
39-
* @param InputInterface $input
40-
* @param OutputInterface $output
41-
*/
42-
protected function initialize(InputInterface $input, OutputInterface $output)
38+
protected function initialize(InputInterface $input, OutputInterface $output): void
4339
{
4440
parent::initialize($input, $output);
4541

46-
$extensionConfiguration = new \TYPO3\CMS\Core\Configuration\ExtensionConfiguration();
42+
$extensionConfiguration = new ExtensionConfiguration();
4743
$contactsConfiguration = $extensionConfiguration->get('contacts');
4844

4945
$this->googleMapsApiKey = $contactsConfiguration['googleMapsApiKey'];
5046
}
5147

52-
/**
53-
* @param InputInterface $input
54-
* @param OutputInterface $output
55-
*/
56-
protected function execute(InputInterface $input, OutputInterface $output)
48+
protected function execute(InputInterface $input, OutputInterface $output): void
5749
{
5850
$output->writeln('');
5951

@@ -140,11 +132,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
140132
$progress->finish();
141133
}
142134

143-
/**
144-
* @param string $address
145-
*
146-
* @return array
147-
*/
148135
protected function geocode(string $address): array
149136
{
150137
$address = urlencode($address);

Classes/Controller/ActionController.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
use Extcode\Contacts\Domain\Model\Dto\Demand;
1313
use Extcode\Contacts\Domain\Repository\CategoryRepository;
14-
use TYPO3\CMS\Frontend\Page\PageRepository;
14+
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
15+
use TYPO3\CMS\Core\Utility\GeneralUtility;
1516

1617
class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
1718
{
@@ -21,7 +22,7 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
2122
protected $categoryRepository;
2223

2324
/**
24-
* @var PageRepository
25+
* @var \TYPO3\CMS\Core\Domain\Repository\PageRepository
2526
*/
2627
protected $pageRepository;
2728

@@ -34,7 +35,7 @@ public function injectCategoryRepository(CategoryRepository $categoryRepository)
3435
}
3536

3637
/**
37-
* @param PageRepository $pageRepository
38+
* @param \TYPO3\CMS\Core\Domain\Repository\PageRepository $pageRepository
3839
*/
3940
public function injectPageRepository(PageRepository $pageRepository)
4041
{
@@ -82,7 +83,7 @@ protected function createDemandObjectFromSettings(array $settings) : Demand
8283
protected function addCategoriesToDemandObjectFromSettings(&$demand)
8384
{
8485
if ($this->settings['categoriesList']) {
85-
$selectedCategories = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(
86+
$selectedCategories = GeneralUtility::intExplode(
8687
',',
8788
$this->settings['categoriesList'],
8889
true

0 commit comments

Comments
 (0)