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
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Adapted from https://github.com/TYPO3GmbH/blog/blob/master/.github/workflows/ci.yml
name: CI

on:
push:
branches: [TYPO3_11]
pull_request:
branches: [TYPO3_11]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
typo3: [ '^11.5' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]

steps:
- id: checkout
name: Checkout
uses: actions/checkout@v5

- id: setup_php
name: Set up PHP version ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2

- name: Validate composer.json and composer.lock
run: composer validate

- id: security
name: Security audit
if: ${{ always() && steps.install.conclusion == 'success' }}
run: |
composer audit

- id: composer-cache-vars
name: Composer Cache Vars
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "timestamp=$(date +"%s")" >> $GITHUB_OUTPUT

- id: composer-cache-dependencies
name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-vars.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.typo3 }}-${{ steps.composer-cache-vars.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.typo3 }}-
${{ runner.os }}-composer-${{ matrix.php }}-
${{ runner.os }}-composer-

- id: install
name: Install dependencies with typo3/cms-core:${{ matrix.typo3 }}
run: |
composer require typo3/cms-core:${{ matrix.typo3 }} --no-progress --no-update
composer require typo3/cms-backend:${{ matrix.typo3 }} --no-progress --no-update
composer require typo3/cms-extbase:${{ matrix.typo3 }} --no-progress --no-update
composer require typo3/cms-recordlist:${{ matrix.typo3 }} --no-progress --no-update
composer require typo3/cms-frontend:${{ matrix.typo3 }} --no-progress --no-update
composer require typo3/cms-rte-ckeditor:${{ matrix.typo3 }} --no-progress --no-update
composer install
git checkout composer.json

- id: lint
name: Lint
if: ${{ always() && steps.install.conclusion == 'success' }}
run: |
composer ci:test:php:lint

- id: phpstan
name: PHPStan
if: ${{ always() && steps.install.conclusion == 'success' }}
run: |
composer ci:test:php:phpstan -- --error-format=github

- id: functional
name: Functional Tests
if: ${{ always() && steps.install.conclusion == 'success' }}
env:
typo3DatabaseDriver: pdo_sqlite
run: |
composer ci:test:php:functional

- id: coverage
name: Generate Coverage Report
if: ${{ always() && steps.functional.conclusion == 'success' && matrix.php == '8.1' }}
env:
typo3DatabaseDriver: pdo_sqlite
run: |
composer ci:coverage:functional

- id: upload-coverage
name: Upload Coverage to Codecov
if: ${{ always() && steps.coverage.conclusion == 'success' && matrix.php == '8.1' }}
uses: codecov/codecov-action@v5
with:
files: .Build/logs/clover.xml
fail_ci_if_error: false
27 changes: 0 additions & 27 deletions .github/workflows/phpcs.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/phpstan.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/testing.yml

This file was deleted.

161 changes: 161 additions & 0 deletions Build/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
parameters:
ignoreErrors:
-
message: "#^Method Netresearch\\\\RteCKEditorImage\\\\Backend\\\\Preview\\\\RteImagePreviewRenderer\\:\\:walk\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: ../Classes/Backend/Preview/RteImagePreviewRenderer.php

-
message: "#^Property Netresearch\\\\RteCKEditorImage\\\\Backend\\\\Preview\\\\RteImagePreviewRenderer\\:\\:\\$toRemove type has no value type specified in iterable type array\\.$#"
count: 1
path: ../Classes/Backend/Preview/RteImagePreviewRenderer.php

-
message: "#^Call to an undefined method object\\:\\:getFileObject\\(\\)\\.$#"
count: 1
path: ../Classes/Controller/ImageLinkRenderingController.php

-
message: "#^Call to an undefined method object\\:\\:getLogger\\(\\)\\.$#"
count: 1
path: ../Classes/Controller/ImageLinkRenderingController.php

-
message: "#^Call to an undefined method object\\:\\:setMagicImageMaximumDimensions\\(\\)\\.$#"
count: 1
path: ../Classes/Controller/ImageLinkRenderingController.php

-
message: "#^PHPDoc tag @var for variable \\$result has no value type specified in iterable type array\\.$#"
count: 1
path: ../Classes/Controller/ImageLinkRenderingController.php

-
message: "#^Call to an undefined method object\\:\\:getFileObject\\(\\)\\.$#"
count: 1
path: ../Classes/Controller/ImageRenderingController.php

-
message: "#^Call to an undefined method object\\:\\:getLogger\\(\\)\\.$#"
count: 1
path: ../Classes/Controller/ImageRenderingController.php

-
message: "#^Call to an undefined method object\\:\\:setMagicImageMaximumDimensions\\(\\)\\.$#"
count: 1
path: ../Classes/Controller/ImageRenderingController.php

-
message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|null given\\.$#"
count: 1
path: ../Classes/Controller/ImageRenderingController.php

-
message: "#^Parameter \\#1 \\$(string1|str1) of function strncasecmp expects string, string\\|null given\\.$#"
count: 1
path: ../Classes/Controller/ImageRenderingController.php

-
message: "#^Parameter \\#1 \\$(string1|str1) of function strncmp expects string, string\\|null given\\.$#"
count: 1
path: ../Classes/Controller/ImageRenderingController.php

-
message: "#^PHPDoc tag @var for variable \\$bparams has no value type specified in iterable type array\\.$#"
count: 1
path: ../Classes/Controller/SelectImageController.php

-
message: "#^Property Netresearch\\\\RteCKEditorImage\\\\Controller\\\\SelectImageController\\:\\:\\$magicImageService \\(TYPO3\\\\CMS\\\\Core\\\\Resource\\\\Service\\\\MagicImageService\\) does not accept object\\.$#"
count: 1
path: ../Classes/Controller/SelectImageController.php

-
message: "#^Property Netresearch\\\\RteCKEditorImage\\\\Controller\\\\SelectImageController\\:\\:\\$resourceFactory \\(TYPO3\\\\CMS\\\\Core\\\\Resource\\\\ResourceFactory\\) does not accept object\\.$#"
count: 1
path: ../Classes/Controller/SelectImageController.php

-
message: "#^Property Netresearch\\\\RteCKEditorImage\\\\Controller\\\\SelectImageController\\:\\:\\$richText \\(TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\Richtext\\) does not accept object\\.$#"
count: 1
path: ../Classes/Controller/SelectImageController.php

-
message: "#^Call to an undefined method object\\:\\:createMagicImage\\(\\)\\.$#"
count: 3
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Call to an undefined method object\\:\\:getCache\\(\\)\\.$#"
count: 1
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Call to an undefined method object\\:\\:getDefaultBackendStoragePid\\(\\)\\.$#"
count: 1
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Call to an undefined method object\\:\\:getFileObject\\(\\)\\.$#"
count: 2
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Call to an undefined method object\\:\\:load\\(\\)\\.$#"
count: 1
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Call to an undefined method object\\:\\:parse\\(\\)\\.$#"
count: 1
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Call to an undefined method object\\:\\:retrieveFileOrFolderObject\\(\\)\\.$#"
count: 1
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Call to an undefined method object\\:\\:setAspect\\(\\)\\.$#"
count: 2
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Call to an undefined method object\\:\\:setMagicImageMaximumDimensions\\(\\)\\.$#"
count: 1
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Class Netresearch\\\\RteCKEditorImage\\\\Database\\\\RteImagesDbHook has an uninitialized property \\$pObj\\. Give it default value or assign it in the constructor\\.$#"
count: 1
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Class Netresearch\\\\RteCKEditorImage\\\\Database\\\\RteImagesDbHook has an uninitialized property \\$transformationKey\\. Give it default value or assign it in the constructor\\.$#"
count: 1
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Method Netresearch\\\\RteCKEditorImage\\\\Database\\\\RteImagesDbHook\\:\\:getProcessedFile\\(\\) has parameter \\$attribArray with no value type specified in iterable type array\\.$#"
count: 1
path: ../Classes/Database/RteImagesDbHook.php

-
message: "#^Call to an undefined method object\\:\\:getLogger\\(\\)\\.$#"
count: 1
path: ../ext_localconf.php

-
message: "#^Call to an undefined method object\\:\\:getMessageQueueByIdentifier\\(\\)\\.$#"
count: 1
path: ../ext_localconf.php

-
message: "#^Call to an undefined method object\\:\\:getQueryBuilderForTable\\(\\)\\.$#"
count: 1
path: ../ext_localconf.php

-
message: "#^Call to an undefined method object\\:\\:isEnvironmentInBackendMode\\(\\)\\.$#"
count: 1
path: ../ext_localconf.php
28 changes: 28 additions & 0 deletions Build/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
includes:
- %currentWorkingDirectory%/.Build/vendor/phpstan/phpstan-strict-rules/rules.neon
# - %currentWorkingDirectory%/.Build/vendor/phpstan/phpstan-phpunit/rules.neon
- %currentWorkingDirectory%/Build/phpstan-baseline.neon

parameters:
# Level 8 is appropriate for TYPO3 v11 compatibility
level: 8

paths:
- %currentWorkingDirectory%/Classes/
- %currentWorkingDirectory%/Configuration/
- %currentWorkingDirectory%/Resources/
- %currentWorkingDirectory%/Tests/
- %currentWorkingDirectory%/ext_localconf.php

excludePaths:
- %currentWorkingDirectory%/.Build/*
- %currentWorkingDirectory%/ext_emconf.php

# Strict configuration options for maximum code quality
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: true

# Advanced type inference and checking
inferPrivatePropertyTypeFromConstructor: true
checkMissingCallableSignature: true
checkUninitializedProperties: true
5 changes: 5 additions & 0 deletions Build/phpunit/FunctionalTests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
<directory>../../Tests/Functional/</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">../../Classes</directory>
</include>
</coverage>
<php>
<!--
@deprecated: Set this to not suppress warnings, notices and deprecations in functional tests
Expand Down
Loading