Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- 8.1
- 8.2
- 8.3
- 8.4
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -75,6 +76,8 @@ jobs:
typo3-version: '^12.4'
- php-version: '8.3'
typo3-version: '^12.4'
- php-version: '8.4'
typo3-version: '^12.4'
steps:
- uses: actions/checkout@v4

Expand All @@ -94,7 +97,7 @@ jobs:
- name: Code Quality (by PHPStan)
run: vendor/bin/phpstan analyse -c Build/phpstan.neon

tests-acceptance:
test-php:
runs-on: ubuntu-latest
needs:
- coding-guideline
Expand All @@ -115,6 +118,9 @@ jobs:
- name: Run Unit Tests PHP8.3
run: nix-shell --arg phpVersion \"php83\" --pure --run project-test-unit

- name: Run Unit Tests PHP8.4
run: nix-shell --arg phpVersion \"php84\" --pure --run project-test-unit

- name: Run Functional Tests PHP8.1
run: nix-shell --arg phpVersion \"php81\" --pure --run project-test-functional

Expand All @@ -124,6 +130,20 @@ jobs:
- name: Run Functional Tests PHP8.3
run: nix-shell --arg phpVersion \"php83\" --pure --run project-test-functional

- name: Run Functional Tests PHP8.4
run: nix-shell --arg phpVersion \"php84\" --pure --run project-test-functional

test-acceptance:
runs-on: ubuntu-latest
needs:
- test-php
steps:
- uses: actions/checkout@v3

- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Run Acceptance Tests PHP8.1
run: nix-shell --arg phpVersion \"php81\" --pure --run project-test-acceptance

Expand All @@ -132,3 +152,6 @@ jobs:

- name: Run Acceptance Tests PHP8.3
run: nix-shell --arg phpVersion \"php83\" --pure --run project-test-acceptance

- name: Run Acceptance Tests PHP8.4
run: nix-shell --arg phpVersion \"php84\" --pure --run project-test-acceptance
105 changes: 42 additions & 63 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ cache:
- .php_cs.cache

variables:
COMPOSER_CACHE_DIR: ".composer"
TYPO3_PATH_WEB: "$CI_PROJECT_DIR/.build/public"
MYSQL_DATABASE: "typo3"
MYSQL_ROOT_PASSWORD: "joh316"
typo3DatabaseName: "typo3"
typo3DatabaseHost: "mysql"
typo3DatabaseUsername: "root"
typo3DatabasePassword: "joh316"
TYPO3_VERSION: ^12.4

before_script:
- apk add git --update
Expand All @@ -23,32 +16,13 @@ stages:
- documentation

lint:cgl:
image: $CI_REGISTRY/containers/phpunit-with-php-8.1:main
image: $CI_REGISTRY/containers/phpunit-with-php-8.2:main
stage: lint
before_script:
- sed -i -e "s#ssh://git@code.extco.de:22722#https://gitlab-ci-token:$CI_JOB_TOKEN@code.extco.de#g" composer.json
- composer config platform.php 8.1
- composer remove typo3/cms-core --no-update
- composer remove typo3/cms-* --no-update
- composer install --no-progress --no-ansi --no-interaction
script:
- vendor/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --using-cache=no --path-mode=intersection ./

lint:typoscriptcgl:
image: php:8.1-alpine
stage: lint
before_script:
- apk add --no-cache bash curl git mercurial openssh openssl parallel subversion tini zlib-dev libzip-dev zip icu-dev g++
- docker-php-ext-install mysqli && docker-php-ext-install zip && docker-php-ext-configure intl && docker-php-ext-install intl && docker-php-ext-enable intl
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === trim(file_get_contents('installer.sig'))) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php --no-ansi --install-dir=/usr/bin --filename=composer
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- sed -i -e "s#ssh://git@code.extco.de:22722#https://gitlab-ci-token:$CI_JOB_TOKEN@code.extco.de#g" composer.json
- composer config platform.php 8.1
- composer remove typo3/cms-core --no-update
- composer install --no-progress --no-ansi --no-interaction
script:
- vendor/bin/typoscript-lint -c Build/typoscriptlint.yaml Configuration

lint:yaml:
Expand All @@ -59,23 +33,31 @@ lint:yaml:
script:
- yamllint -c Build/yamllint.yaml Configuration/ Resources/

lint:php81:
.lint_php: &lint_php
stage: lint
image: php:8.1-alpine
image: $CONTAINER_IMAGE
script:
- find . -name \*.php -exec php -l "{}" \;
- find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l

lint:php81:
<<: *lint_php
variables:
CONTAINER_IMAGE: php:8.1-alpine

lint:php82:
stage: lint
image: php:8.2-alpine
script:
- find . -name \*.php -exec php -l "{}" \;
<<: *lint_php
variables:
CONTAINER_IMAGE: php:8.2-alpine

lint:php83:
stage: lint
image: php:8.3-alpine
script:
- find . -name \*.php -exec php -l "{}" \;
<<: *lint_php
variables:
CONTAINER_IMAGE: php:8.3-alpine

lint:php84:
<<: *lint_php
variables:
CONTAINER_IMAGE: php:8.4-alpine

phpstan:analyse:
image: $CI_REGISTRY/containers/phpunit-with-php-8.1:main
Expand Down Expand Up @@ -103,26 +85,25 @@ phpstan:analyse:
- vendor/bin/phpunit -c Build/UnitTests.xml
- typo3DatabaseDriver=pdo_sqlite vendor/bin/phpunit -c Build/FunctionalTests.xml

# Build in PHP 8.1 and TYPO3 12.4
test:php81:typo3_12:
test:php81:
<<: *test_php
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.1:main
TYPO3_VERSION: ^12.4

# Build in PHP 8.2 and TYPO3 12.4
test:php82:typo3_12:
test:php82:
<<: *test_php
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.2:main
TYPO3_VERSION: ^12.4

# Build in PHP 8.3 and TYPO3 12.4
test:php83:typo3_12:
test:php83:
<<: *test_php
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.3:main
TYPO3_VERSION: ^12.4

test:php84:
<<: *test_php
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/phpunit-with-php-8.4:main

.test_codeception: &test_codeception
stage: test
Expand All @@ -148,33 +129,31 @@ test:php83:typo3_12:
expire_in: 1 day
when: always

# Build in PHP 8.1 and TYPO3 12.4
test:codception:php81:typo3_12:
codeception:php81:
<<: *test_codeception
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/codeception-with-php-8.1:main
TYPO3_VERSION: ^12.4
GECKODRIVER_VERSION: v0.34.0

# Build in PHP 8.2 and TYPO3 12.4
test:codception:php82:typo3_12:
codeception:php82:
<<: *test_codeception
needs:
- test:codception:php81:typo3_12
- codeception:php81
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/codeception-with-php-8.2:main
TYPO3_VERSION: ^12.4
GECKODRIVER_VERSION: v0.34.0

# Build in PHP 8.3 and TYPO3 12.4
test:codception:php83:typo3_12:
codeception:php83:
<<: *test_codeception
needs:
- test:codception:php82:typo3_12
- codeception:php82
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/codeception-with-php-8.3:main
TYPO3_VERSION: ^12.4
GECKODRIVER_VERSION: v0.34.0

codeception:php84:
<<: *test_codeception
needs:
- codeception:php83
variables:
CONTAINER_IMAGE: $CI_REGISTRY/containers/codeception-with-php-8.4:main

documentation:
stage: documentation
Expand Down
4 changes: 2 additions & 2 deletions Classes/Controller/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function teaserAction(): ResponseInterface
* @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("event")
*/
#[IgnoreValidation(['value' => 'event'])]
public function showAction(Event $event = null): ResponseInterface
public function showAction(?Event $event = null): ResponseInterface
{
if (!$event) {
$event = $this->getEvent();
Expand All @@ -117,7 +117,7 @@ public function showAction(Event $event = null): ResponseInterface

#[IgnoreValidation(['value' => 'eventDate'])]
#[IgnoreValidation(['value' => 'priceCategory'])]
public function formAction(EventDate $eventDate = null, PriceCategory $priceCategory = null): ResponseInterface
public function formAction(?EventDate $eventDate = null, ?PriceCategory $priceCategory = null): ResponseInterface
{
if (!$eventDate) {
$arguments = $this->request->getArguments();
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Finisher/Form/AddToCartFinisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getProductFromForm(
protected function getProductFromEventDate(
int $quantity,
array $taxClasses,
array $feVariants = null
array $feVariants = []
): Product {
$event = $this->eventDate->getEvent();
$title = implode(' - ', [$event->getTitle(), $this->eventDate->getTitle()]);
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Repository/CategoryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

class CategoryRepository extends Repository
{
public function findAllAsRecursiveTreeArray(Category $selectedCategory = null): array
public function findAllAsRecursiveTreeArray(?Category $selectedCategory = null): array
{
$categoriesArray = $this->findAllAsArray($selectedCategory);
return $this->buildSubcategories($categoriesArray, null);
}

public function findAllAsArray(Category $selectedCategory = null): array
public function findAllAsArray(?Category $selectedCategory = null): array
{
$localCategories = $this->findAll();
$categories = [];
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Sometimes minor versions also result in minor adjustments to own templates or co

| Cart Events | TYPO3 | PHP | Support/Development |
|-------------|------------|-----------|--------------------------------------|
| 5.x.x | 12.4 | 8.1+ | Features, Bugfixes, Security Updates |
| 5.x.x | 12.4 | 8.1 - 8.4 | Features, Bugfixes, Security Updates |
| 4.x.x | 10.4, 11.5 | 7.2+ | Bugfixes, Security Updates |
| 3.x.x | 10.4 | 7.2 - 7.4 | Security Updates |
| 2.x.x | 9.5 | 7.2 - 7.4 | |
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
},
"require": {
"php": "^8.1",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"ext-json": "*",
"ext-pdo": "*",
"extcode/cart": "^10.0",
Expand Down