Skip to content

Commit

Permalink
[TASK] Add TYPO3 10.4 Compatibility
Browse files Browse the repository at this point in the history
Resolves: #20
  • Loading branch information
extcode committed Aug 6, 2021
1 parent 6a7d9b6 commit 881e2b6
Show file tree
Hide file tree
Showing 30 changed files with 1,149 additions and 857 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.Build
.build
composer.lock

.php_cs.cache
.phplint.cache

.DS_Store
.idea
79 changes: 56 additions & 23 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,33 @@ cache:

variables:
COMPOSER_CACHE_DIR: ".composer"
TYPO3_PATH_WEB: "$CI_PROJECT_DIR/.Build/Web"
MYSQL_DATABASE: "typo3"
MYSQL_ROOT_PASSWORD: "joh316"
typo3DatabaseName: "typo3"
typo3DatabaseHost: "mysql"
typo3DatabaseUsername: "root"
typo3DatabasePassword: "joh316"

before_script:
- apk add git --update

stages:
- lint
- documentation
- analysis

lint:cgl:
image: composer:1.6
image: composer:2.0
stage: lint
before_script:
- composer config platform.php 7.4
- composer remove typo3/cms-core --no-update
- composer install --no-progress --no-ansi --no-interaction
script:
- .Build/bin/php-cs-fixer fix --config=Build/.php_cs.dist -v --dry-run --using-cache=no --path-mode=intersection ./
- .build/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --using-cache=no --path-mode=intersection ./

lint:typoscriptcgl:
stage: lint
image: composer:1.6
image: composer:2.0
script:
- composer config platform.php 7.4
- composer remove typo3/cms-core --no-update
- composer install --no-progress --no-ansi --no-interaction
- .Build/bin/typoscript-lint -c tslint.yaml
- .build/bin/typoscript-lint -c tslint.yaml

lint:yaml:
stage: lint
Expand All @@ -45,18 +42,6 @@ lint:yaml:
script:
- yamllint -c Build/yamllint.yaml Configuration/ Resources/ .travis.yml

lint:php70:
stage: lint
image: php:7.0-alpine
script:
- find . -name \*.php -exec php -l "{}" \;

lint:php71:
stage: lint
image: php:7.1-alpine
script:
- find . -name \*.php -exec php -l "{}" \;

lint:php72:
stage: lint
image: php:7.2-alpine
Expand All @@ -74,3 +59,51 @@ lint:php74:
image: php:7.4-alpine
script:
- find . -name \*.php -exec php -l "{}" \;

documentation:
stage: documentation
image:
name: t3docs/render-documentation:v2.4.0
entrypoint: [""]
before_script:
- cp -a ${CI_PROJECT_DIR}/. /PROJECT
- mkdir -p ${CI_PROJECT_DIR}/Documentation-GENERATED-temp
script:
- cd /ALL/venv
- /ALL/Menu/mainmenu.sh makehtml-no-cache -c resultdir ${CI_PROJECT_DIR}/Documentation-GENERATED-temp
artifacts:
paths:
- ${CI_PROJECT_DIR}/Documentation-GENERATED-temp/Result/project/0.0.0
expire_in: 1 day
when: always

sonarqube:
stage: analysis
image: ciricihq/gitlab-sonar-scanner
variables:
SONAR_URL: "https://sonar.extco.de"
SONAR_PROJECT_NAME: "$CI_PROJECT_NAME"
SONAR_TOKEN: "$SONAR_TOKEN"
SONAR_PROJECT_VERSION: "$CI_JOB_ID"
SONAR_ANALYSIS_MODE: "issues"
SONAR_SOURCES: "./Classes"
SONAR_GITLAB_PROJECT_ID: "$CI_PROJECT_ID"
script:
- echo "sonar.projectKey=cart_paypal-5.x" > sonar-project.properties
- gitlab-sonar-scanner -Dsonar.php.coverage.reportPath=phpunit.coverage.xml -Dsonar.php.tests.reportPath=phpunit.report.xml
allow_failure: true

sonarqube-reports:
stage: analysis
image: ciricihq/gitlab-sonar-scanner
variables:
SONAR_URL: "https://sonar.extco.de"
SONAR_PROJECT_NAME: "$CI_PROJECT_NAME"
SONAR_TOKEN: "$SONAR_TOKEN"
SONAR_PROJECT_VERSION: "$CI_JOB_ID"
SONAR_ANALYSIS_MODE: "publish"
SONAR_SOURCES: "./Classes"
SONAR_TESTS: "./Tests"
script:
- echo "sonar.projectKey=cart_paypal-5.x" > sonar-project.properties
- gitlab-sonar-scanner -Dsonar.php.coverage.reportPath=phpunit.coverage.xml -Dsonar.php.tests.reportPath=phpunit.report.xml
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ matrix:
fast_finish: true
include:
- php: 7.4
env: TYPO3_VERSION=^9.5
env: TYPO3_VERSION=^10.4
- php: 7.3
env: TYPO3_VERSION=^9.5
env: TYPO3_VERSION=^10.4
- php: 7.2
env: TYPO3_VERSION=^9.5
- php: 7.1
env: TYPO3_VERSION=^9.5
- php: 7
env: TYPO3_VERSION=^9.5
env: TYPO3_VERSION=^10.4

cache:
directories:
Expand Down
34 changes: 19 additions & 15 deletions Build/.php_cs.dist → Build/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<?php

if (PHP_SAPI !== 'cli') {
die('This script supports command line usage only. Please check your command.');
echo ('This script supports command line usage only. Please check your command.');
exit(1);
}

return PhpCsFixer\Config::create()
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/../')
->exclude('.build')
->exclude('Documentation')
->exclude('Resources')
->notName('ext_emconf.php')
->notName('ext_localconf.php')
->notName('ext_tables.php');

$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
Expand All @@ -17,15 +28,14 @@
'ordered_imports' => true,
'single_quote' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'phpdoc_no_package' => true,
'no_extra_blank_lines' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'no_blank_lines_after_phpdoc' => true,
'array_syntax' => ['syntax' => 'short'],
'whitespace_after_comma_in_array' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'single_line_comment_style' => true,
'no_alias_functions' => true,
'lowercase_cast' => true,
'no_leading_namespace_whitespace' => true,
Expand All @@ -36,13 +46,7 @@
'phpdoc_no_empty_return' => true,
'phpdoc_trim' => true
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__ . '/../')
->exclude('.Build')
->exclude('Documentation')
->exclude('Resources')
->notName('ext_emconf.php')
->notName('ext_localconf.php')
->notName('ext_tables.php')
);
->setUsingCache(false)
->setFinder($finder);

return $config;
7 changes: 7 additions & 0 deletions Build/phplint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
path: ./../
jobs: 10
cache: .phplint.cache
extensions:
- php
exclude:
- .build
19 changes: 19 additions & 0 deletions Build/typoscriptlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
sniffs:
- class: Indentation
parameters:
useSpaces: true
indentPerLevel: 4
indentConditions: false
- class: DeadCode
- class: OperatorWhitespace
- class: RepeatingRValue
parameters:
allowedRightValues:
- "TYPO3\\CMS\\Frontend\\DataProcessing\\DatabaseQueryProcessor"
- class: DuplicateAssignment
- class: EmptySection
- class: NestingConsistency
parameters:
commonPathPrefixThreshold: 1
filePatterns:
- "*.typoscript"
Loading

0 comments on commit 881e2b6

Please sign in to comment.