From 9ccc1da39476eaf309f20d54d669a12d20ad71c6 Mon Sep 17 00:00:00 2001 From: Simon Schaufelberger Date: Sat, 24 May 2025 01:06:15 +0200 Subject: [PATCH] [TASK] Upgrade to TYPO3 13 --- .editorconfig | 41 +++++---- .gitattributes | 9 -- .github/ISSUE_TEMPLATE/bug-report.md | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 4 +- .github/workflows/ci.yml | 88 +++++++++++++++++++ .github/workflows/dependabot-auto-merge.yml | 48 ++++++++++ .github/workflows/php_cs_fixer.yaml | 48 ---------- .github/workflows/publish.yml | 48 ++-------- .github/workflows/tests.yml | 39 -------- Build/bin/console | 16 ++++ Build/ecs/ecs.php | 87 ++++++++++++++++++ Build/fractor/fractor.php | 35 ++++++++ Build/rector/rector.php | 60 +++++++++++++ Classes/Hooks/DataHandler.php | 2 +- Configuration/TCA/Overrides/pages.php | 19 +++- Configuration/TCA/Overrides/tt_content.php | 19 +++- README.md | 16 ++-- .../Private/Language/de.locallang_db.xlf | 9 +- Resources/Private/Language/locallang_db.xlf | 9 +- Resources/Public/Icons/Extension.svg | 10 +-- composer.json | 80 +++++++++++------ ext_emconf.php | 2 +- ext_localconf.php | 6 +- rector.php | 48 ---------- 24 files changed, 481 insertions(+), 264 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/dependabot-auto-merge.yml delete mode 100644 .github/workflows/php_cs_fixer.yaml delete mode 100644 .github/workflows/tests.yml create mode 100644 Build/bin/console create mode 100644 Build/ecs/ecs.php create mode 100644 Build/fractor/fractor.php create mode 100644 Build/rector/rector.php delete mode 100644 rector.php diff --git a/.editorconfig b/.editorconfig index 2d6ae2a..5a06f26 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,36 +1,43 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file root = true +# Unix-style newlines with a newline ending every file [*] charset = utf-8 end_of_line = lf -insert_final_newline = true indent_style = space indent_size = 4 +insert_final_newline = true trim_trailing_whitespace = true -[*.php] -indent_size = 4 -indent_style = space - -[*.{html,js,css}] -indent_size = 4 +# JSON-Files +[*.json] indent_style = tab -[*.{yml,txt,md,sql}] -indent_size = 2 +[composer.json] indent_style = space -[*.json] +# ReST files +[{*.rst,*.rst.txt}] indent_size = 4 -indent_style = space +max_line_length = 80 -[*.{xml,xlf,xsd}] -indent_size = 2 -indent_style = tab +# MD-Files +[*.md] +indent_size = 4 +max_line_length = 80 -[*.{yml,yaml}] +# YAML-Files +[{*.yml,*.yaml}] indent_size = 2 -[*.typoscript] -indent_size = 4 +# XLF-Files +[*.xlf] +indent_style = tab + +# SQL-Files +[*.sql] indent_style = tab +indent_size = 2 diff --git a/.gitattributes b/.gitattributes index d28d8c9..9276800 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,26 +1,17 @@ * text=auto -*.css linguist-vendored -*.scss linguist-vendored # Enforce checkout with linux lf consistent over all platforms *.html text eol=lf -*.css text eol=lf *.tmpl text eol=lf -*.less text eol=lf -*.scss text eol=lf -*.js text eol=lf *.json text eol=lf *.php text eol=lf *.rst text eol=lf *.md text eol=lf *.yml text eol=lf *.yaml text eol=lf -*.ts text eol=lf -*.typoscript text eol=lf *.xlf text eol=lf *.sh text eol=lf *.sql text eol=lf -*.t3s text eol=lf *.txt text eol=lf /Documentation export-ignore diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index e13e330..f542da5 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -11,8 +11,8 @@ assignees: '' ## Prerequisites -* [ ] Can you reproduce the problem on TYPO3 v11.5 LTS * [ ] Can you reproduce the problem on TYPO3 v12.4 LTS +* [ ] Can you reproduce the problem on TYPO3 v13.4 LTS * [ ] Can you reproduce the problem on TYPO3 dev-main * [ ] Did you [perform a search](https://github.com/simonschaufi/lock_element/issues) to see if your bug or enhancement is already reported? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3d2629f..5001cbc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,10 +8,8 @@ ## Prerequisites -* [ ] Changes have been tested on TYPO3 v12.4 LTS -* [ ] Changes have been tested on TYPO3 v11.5 LTS +* [ ] Changes have been tested on TYPO3 v13.4 LTS * [ ] Changes have been tested on TYPO3 dev-main -* [ ] Changes have been tested on PHP 7.4 * [ ] Changes have been tested on PHP 8.x * [ ] Changes have been checked for CGL compliance `php-cs-fixer fix` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8737824 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,88 @@ +name: CI with Composer scripts +on: + push: + paths: + - '**.php' + - '.github/workflows/ci.yml' + - 'composer.json' + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + php-lint: + runs-on: ubuntu-latest + timeout-minutes: 5 + strategy: + fail-fast: true + matrix: + php: [8.2, 8.3, 8.4] + + name: "PHP linter - ${{ matrix.php }}" + + steps: + - name: "Checkout code" + uses: actions/checkout@v4 + + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + coverage: none + + - name: "Run PHP lint" + run: find .*.php *.php Classes Configuration Tests -name '*.php' -print0 | xargs -r -0 -n 1 -P 4 php -l + + code-quality: + runs-on: ubuntu-latest + timeout-minutes: 5 + strategy: + fail-fast: true + matrix: + command: + - "composer:normalize" + - "composer:psr-verify" + - "php:ecs" + - "php:rector" + - "php:fractor" + - "yaml:lint" + - "xliff:lint" + php: [8.2] + + name: "Code quality checks" + + steps: + - name: "Checkout code" + uses: actions/checkout@v4 + + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + coverage: none + tools: composer:v2 + + - name: "Show Composer version" + run: composer --version + + - name: "Show the Composer configuration" + run: composer config --global --list + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v4 + with: + key: "php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}" + path: ~/.cache/composer + restore-keys: "php${{ matrix.php }}-composer-\n" + + - name: "Install Composer dependencies" + run: composer install --no-progress + + - name: "List Installed Dependencies" + run: composer show -D + + - name: "Run command" + run: composer ci:${{ matrix.command }} diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..ff47189 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,48 @@ +# Copied from https://github.com/spatie/package-skeleton-laravel/blob/main/.github/workflows/dependabot-auto-merge.yml +# See https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request +name: dependabot-auto-merge + +# We're using pull_request_target instead of pull_request due to permission issues with the pull_request target: +# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#responding-to-events +on: pull_request_target + +permissions: + pull-requests: write + contents: write + +jobs: + dependabot: + name: "Dependabot auto-merge" + runs-on: ubuntu-latest + timeout-minutes: 5 + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - name: "Dependabot metadata" + # https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#fetch-metadata-about-a-pull-request + id: metadata + uses: dependabot/fetch-metadata@v2.4.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + +# does not work, see https://github.com/dependabot/fetch-metadata/issues/499 +# - name: "Auto-merge Dependabot PRs for semver-minor updates" +# if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' }} +# run: gh pr merge --auto --rebase "$PR_URL" +# env: +# PR_URL: "${{ github.event.pull_request.html_url }}" +# github-token: "${{ secrets.GITHUB_TOKEN }}" +# +# - name: "Auto-merge Dependabot PRs for semver-patch updates" +# if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }} +# run: gh pr merge --auto --rebase "$PR_URL" +# env: +# PR_URL: "${{ github.event.pull_request.html_url }}" +# github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: "Enable auto-merge" + if: ${{ steps.metadata.outputs.dependency-type == 'direct:development' }} + run: gh pr merge -R "${{ github.repository }}" --squash --auto "${{ github.event.pull_request.number }}" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/php_cs_fixer.yaml b/.github/workflows/php_cs_fixer.yaml deleted file mode 100644 index 38f9112..0000000 --- a/.github/workflows/php_cs_fixer.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Format (PHP) - -on: [push, pull_request] - -jobs: - php-cs-fixer: - runs-on: ubuntu-latest - # dont run jobs on forks, because we are not allowed to commit - if: github.event.pull_request.draft == false && github.repository == 'simonschaufi/lock_element' - - permissions: - # Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. - contents: write - - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - # https://github.com/stefanzweifel/git-auto-commit-action#commits-made-by-this-action-do-not-trigger-new-workflow-runs - token: ${{ secrets.PAT }} - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - uses: shivammathur/setup-php@v2 - with: - php-version: 8.3 - coverage: none # disable xdebug, pcov - - - name: Cache Composer Dependencies - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install Composer Dependencies - run: composer install --no-progress - - - name: Run php-cs-fixer - run: .Build/bin/php-cs-fixer fix --diff - - - name: Commit changed files - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Apply php-cs-fixer changes - branch: ${{ github.head_ref }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8db7263..3fd6fd9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,50 +1,18 @@ -name: publish +name: Publish on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + - "**" jobs: publish: - name: Publish new version to TER - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-20.04 - env: - TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }} + runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: "Checkout" + uses: actions/checkout@v4 - - name: Check tag - run: | - if ! [[ ${{ github.ref }} =~ ^refs/tags/v[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then - exit 1 - fi - - - name: Get version - id: get-version - run: echo ::set-output name=version::${GITHUB_REF#refs/tags/v} - - - name: Get comment - id: get-comment - run: | - readonly local comment=$(git tag -n10 -l v${{ steps.get-version.outputs.version }} | sed "s/^v[0-9.]*[ ]*//g") - - if [[ -z "${comment// }" ]]; then - echo ::set-output name=comment::Released version ${{ steps.get-version.outputs.version }} of ${{ env.TYPO3_EXTENSION_KEY }} - else - echo ::set-output name=comment::$comment - fi - - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - name: "Publish new version to TER" + uses: tomasnorre/typo3-upload-ter@v2 with: - php-version: 8.3 - extensions: intl, mbstring, json, zip, curl - - - name: Install tailor - run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest - - - name: Publish to TER - run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" ${{ steps.get-version.outputs.version }} + api-token: ${{ secrets.TYPO3_API_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 9eeebfd..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: tests - -on: [push, pull_request] - -jobs: - tests: - - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - php: [8.1, 8.2, 8.3] - typo3: [^12.4] - - name: P${{ matrix.php }} - T${{ matrix.typo3 }} - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache/files - key: dependencies-typo3-${{ matrix.typo3 }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: intl, mbstring - coverage: none - - - name: Install dependencies - run: composer require "typo3/cms-core:${{ matrix.typo3 }}" --prefer-dist --no-progress --no-interaction - - - name: Check PHP syntax errors - run: find . -name \*.php ! -path "./.Build/*" -print0 | xargs -0 -n1 -P4 php -d display_errors=stderr -n -l > /dev/null diff --git a/Build/bin/console b/Build/bin/console new file mode 100644 index 0000000..54fe102 --- /dev/null +++ b/Build/bin/console @@ -0,0 +1,16 @@ +#!/usr/bin/env php +add(new XliffLintCommand(null, null, null, false)); +$application->add(new LintCommand()); + +exit($application->run()); diff --git a/Build/ecs/ecs.php b/Build/ecs/ecs.php new file mode 100644 index 0000000..7291c20 --- /dev/null +++ b/Build/ecs/ecs.php @@ -0,0 +1,87 @@ +paths([ + __DIR__ . '/../../Build', + __DIR__ . '/../../Classes', + __DIR__ . '/../../Configuration', + __DIR__ . '/../../ext_emconf.php', + __DIR__ . '/../../ext_localconf.php', + ]); + + $ecsConfig->sets([ + SetList::PSR_12, + SetList::CLEAN_CODE, + SetList::SYMPLIFY, + SetList::ARRAY, + SetList::COMMON, + SetList::COMMENTS, + SetList::CONTROL_STRUCTURES, + SetList::DOCBLOCK, + SetList::NAMESPACES, + SetList::PHPUNIT, + SetList::SPACES, + SetList::STRICT, + ]); + + $ecsConfig->ruleWithConfiguration(GeneralPhpdocAnnotationRemoveFixer::class, [ + 'annotations' => ['author', 'package', 'group'], + ]); + + $ecsConfig->ruleWithConfiguration(NoSuperfluousPhpdocTagsFixer::class, [ + 'allow_mixed' => true, + ]); + + $ecsConfig->ruleWithConfiguration(CastSpacesFixer::class, [ + 'space' => 'none', + ]); + + $ecsConfig->ruleWithConfiguration(HeaderCommentFixer::class, [ + 'header' => <<rule(OperatorLinebreakFixer::class); + $ecsConfig->rule(SingleLineEmptyBodyFixer::class); + + $ecsConfig->skip([ + LineLengthFixer::class, + DeclareStrictTypesFixer::class => [ + __DIR__ . '/../../ext_emconf.php', + __DIR__ . '/../../ext_localconf.php', + ], + HeaderCommentFixer::class => [ + __DIR__ . '/../ecs/ecs.php', + __DIR__ . '/../fractor/fractor.php', + __DIR__ . '/../rector/rector.php', + __DIR__ . '/../../ext_emconf.php', + __DIR__ . '/../../ext_localconf.php', + ], + ]); +}; diff --git a/Build/fractor/fractor.php b/Build/fractor/fractor.php new file mode 100644 index 0000000..3c69c0d --- /dev/null +++ b/Build/fractor/fractor.php @@ -0,0 +1,35 @@ +withPaths([ + __DIR__ . '/../../Classes/', + __DIR__ . '/../../Configuration/', + __DIR__ . '/../../Resources/', + __DIR__ . '/../../Tests/', + __DIR__ . '/../../composer.json', + __DIR__ . '/../../ext_emconf.php', + __DIR__ . '/../../ext_localconf.php', + ]) + ->withSets([ + Typo3LevelSetList::UP_TO_TYPO3_13, + ]) + ->withConfiguredRule( + ChangePackageVersionComposerJsonFractor::class, + [ + new PackageAndVersion('typo3/cms-core', '^13.4'), + new PackageAndVersion('typo3/cms-backend', '^13.4'), + ] + ) + ->withOptions([ + XmlProcessorOption::INDENT_CHARACTER => Indent::STYLE_TAB, + XmlProcessorOption::INDENT_SIZE => 1, + ]); diff --git a/Build/rector/rector.php b/Build/rector/rector.php new file mode 100644 index 0000000..a91fede --- /dev/null +++ b/Build/rector/rector.php @@ -0,0 +1,60 @@ +paths([ + __DIR__ . '/../../Build', + __DIR__ . '/../../Classes', + __DIR__ . '/../../Configuration', + __DIR__ . '/../../ext_emconf.php', + __DIR__ . '/../../ext_localconf.php', + ]); + $rectorConfig->phpVersion(PhpVersion::PHP_82); + $rectorConfig->sets([ + // Rector sets + LevelSetList::UP_TO_PHP_82, + SetList::CODE_QUALITY, + SetList::DEAD_CODE, + //SetList::STRICT_BOOLEANS, + //SetList::NAMING, + SetList::PRIVATIZATION, + SetList::TYPE_DECLARATION, + SetList::EARLY_RETURN, + SetList::INSTANCEOF, + // phpunit + PHPUnitSetList::PHPUNIT_100, + PHPUnitSetList::PHPUNIT_110, + + // TYPO3 Sets + Typo3SetList::CODE_QUALITY, + Typo3SetList::GENERAL, + Typo3LevelSetList::UP_TO_TYPO3_13, + ]); + $rectorConfig->phpstanConfig(Typo3Option::PHPSTAN_FOR_RECTOR_PATH); + $rectorConfig->rules([ + AddVoidReturnTypeWhereNoReturnRector::class, + ConvertImplicitVariablesToExplicitGlobalsRector::class, + ]); + $rectorConfig->ruleWithConfiguration(ExtEmConfRector::class, [ + ExtEmConfRector::PHP_VERSION_CONSTRAINT => '8.2.0-8.4.99', + ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '13.4.0-13.4.99', + ExtEmConfRector::ADDITIONAL_VALUES_TO_BE_REMOVED => [], + ]); + $rectorConfig->importNames(); + $rectorConfig->importShortClasses(false); + $rectorConfig->skip([ + ]); +}; diff --git a/Classes/Hooks/DataHandler.php b/Classes/Hooks/DataHandler.php index 6dd2a03..a5a9faf 100755 --- a/Classes/Hooks/DataHandler.php +++ b/Classes/Hooks/DataHandler.php @@ -36,7 +36,7 @@ class DataHandler * * @see \TYPO3\CMS\Core\DataHandling\DataHandler::process_cmdmap */ - public function processCmdmap_preProcess(string &$command, string $table, int $id, &$value, ParentDataHandler $pObj, mixed $pasteUpdate): void + public function processCmdmap_preProcess(string &$command, string $table, int $id, array &$value, ParentDataHandler $pObj, mixed $pasteUpdate): void { if ($command === 'delete' && ($table === 'tt_content' || $table === 'pages')) { // look for lock diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php index d00bff5..1a19f6f 100644 --- a/Configuration/TCA/Overrides/pages.php +++ b/Configuration/TCA/Overrides/pages.php @@ -1,5 +1,22 @@ 'LLL:EXT:lock_element/Resources/Private/Language/locallang_db.xlf:tt_content.tx_lockelement_locked', 'config' => [ 'type' => 'check', - ] + ], ], ]; diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 7961602..ddce130 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,5 +1,22 @@ 'LLL:EXT:lock_element/Resources/Private/Language/locallang_db.xlf:tt_content.tx_lockelement_locked', 'config' => [ 'type' => 'check', - ] + ], ], ]; diff --git a/README.md b/README.md index d60ee0c..fd9b23a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Latest Stable Version](https://poser.pugx.org/simonschaufi/lock-element/v/stable)](https://packagist.org/packages/simonschaufi/lock-element) [![Total Downloads](https://poser.pugx.org/simonschaufi/lock-element/downloads)](https://packagist.org/packages/simonschaufi/lock-element) [![License](https://poser.pugx.org/simonschaufi/lock-element/license)](https://packagist.org/packages/simonschaufi/lock-element) -[![TYPO3](https://img.shields.io/badge/TYPO3-12-orange.svg)](https://get.typo3.org/version/12) +[![TYPO3](https://img.shields.io/badge/TYPO3-13-orange.svg)](https://get.typo3.org/version/13) This extension makes it possible for TYPO3 backend users to lock single pages or content records from being deleted. @@ -31,15 +31,19 @@ Download and install the [extension][3] with the extension manager module in the We follow [**semantic versioning**][5], which means, that * **bugfix updates** (e.g. 1.0.0 => 1.0.1) just includes small bugfixes or security relevant stuff without breaking changes, * **minor updates** (e.g. 1.0.0 => 1.1.0) includes new features and smaller tasks without breaking changes, -* and **major updates** (e.g. 1.0.0 => 2.0.0) breaking changes wich can be refactorings, features or bugfixes. +* and **major updates** (e.g. 1.0.0 => 2.0.0) breaking changes which can be refactorings, features or bugfixes. ### Contribution -**Pull Requests** are gladly welcome! Please don't forget to add an issue and connect it to your pull requests. This -is very helpful to understand what kind of issue the **PR** is going to solve. +**Pull Requests** are gladly welcome! +Please remember to add an issue and connect it to your pull requests. +This is very helpful to understand +what kind of issue the **PR** is going to solve. -Bugfixes: Please describe what kind of bug your fix solve and give us feedback how to reproduce the issue. We're going -to accept only bugfixes if we can reproduce the issue. +Bugfixes: +Please describe what kind of bug your fix solve +and give us feedback on how to reproduce the issue. +We're going to accept only bugfixes if we can reproduce the issue. [2]: https://getcomposer.org/ [3]: https://extensions.typo3.org/extension/lock_element diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index c72f734..2c0a5cc 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -1,12 +1,7 @@ - + -
- database - Language labels for database tables/fields belonging to extension 'lock_element' - Simon Schaufelberger - LFEditor -
+
diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index dfe16c1..7dbbe82 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -1,12 +1,7 @@ - + -
- database - Language labels for database tables/fields belonging to extension 'lock_element' - Simon Schaufelberger - LFEditor -
+
diff --git a/Resources/Public/Icons/Extension.svg b/Resources/Public/Icons/Extension.svg index 7e55a77..becd1b6 100755 --- a/Resources/Public/Icons/Extension.svg +++ b/Resources/Public/Icons/Extension.svg @@ -1,8 +1,6 @@ - - - - - - + + + + diff --git a/composer.json b/composer.json index bd6093b..e78e269 100755 --- a/composer.json +++ b/composer.json @@ -1,51 +1,79 @@ { "name": "simonschaufi/lock-element", - "type": "typo3-cms-extension", "description": "Lock Element. A locked element can't be deleted.", "license": "GPL-2.0-or-later", - "keywords": ["TYPO3 CMS"], + "type": "typo3-cms-extension", + "keywords": [ + "TYPO3 CMS" + ], "require": { - "php": "^8.1", - "typo3/cms-backend": "^12.4", - "typo3/cms-core": "^12.4", - "typo3/cms-extbase": "^12.4" + "php": "^8.2", + "typo3/cms-backend": "^13.4", + "typo3/cms-core": "^13.4" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.64", - "squizlabs/php_codesniffer": "^3.10", - "ssch/typo3-rector": "^2.6", - "typo3/tailor": "^1.6" + "a9f/fractor-composer-json": "^0.5.0", + "a9f/typo3-fractor": "^0.5.0", + "ergebnis/composer-normalize": "^2.47", + "ssch/typo3-rector": "^3.3.0", + "symfony/translation": "^7.1.3", + "symplify/easy-coding-standard": "^12.5" + }, + "replace": { + "typo3-ter/lock-element": "self.version" }, "autoload": { "psr-4": { "SimonSchaufi\\LockElement\\": "Classes" } }, - "replace": { - "typo3-ter/lock-element": "self.version" - }, "config": { - "bin-dir": ".Build/bin", - "vendor-dir": ".Build/vendor", "allow-plugins": { + "a9f/fractor-extension-installer": true, + "ergebnis/composer-normalize": true, "typo3/class-alias-loader": true, "typo3/cms-composer-installers": true - } - }, - "scripts": { - "test": [ - "@test-php-cs-fixer" - ], - "test-php-cs-fixer": [ - ".Build/bin/php-cs-fixer fix -v --dry-run --stop-on-violation" - ] + }, + "bin-dir": ".Build/bin", + "vendor-dir": ".Build/vendor" }, "extra": { "typo3/cms": { - "extension-key": "lock_element", "cms-package-dir": "{$vendor-dir}/typo3/cms", - "app-dir": ".Build", + "extension-key": "lock_element", "web-dir": ".Build/public" } + }, + "scripts": { + "ci:composer:normalize": "@composer normalize --no-check-lock --dry-run", + "ci:composer:psr-verify": "@composer dumpautoload --optimize --strict-psr --no-plugins", + "ci:php:ecs": ".Build/bin/ecs --config=Build/ecs/ecs.php", + "ci:php:fractor": ".Build/bin/fractor process --config Build/fractor/fractor.php --dry-run", + "ci:php:rector": ".Build/bin/rector process --config Build/rector/rector.php --dry-run", + "ci:xliff:lint": "php Build/bin/console lint:xliff Resources/Private/Language", + "ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*node_modules/*' -regextype egrep -regex '.*.ya?ml$' | xargs -r php ./.Build/bin/yaml-lint", + "fix:composer:normalize": "@composer normalize --no-check-lock", + "fix:php:ecs": ".Build/bin/ecs --config=Build/ecs/ecs.php --fix", + "fix:php:fractor": ".Build/bin/fractor process --config Build/fractor/fractor.php", + "fix:php:rector": ".Build/bin/rector process --config Build/rector/rector.php", + "test": [ + "@fix:php:fractor", + "@fix:composer:normalize", + "@fix:php:rector", + "@fix:php:ecs" + ] + }, + "scripts-descriptions": { + "ci:composer:normalize": "Checks the composer.json.", + "ci:composer:psr-verify": "Verifies PSR-4 namespace correctness.", + "ci:php:ecs": "Checks the code style with easy coding standard.", + "ci:php:fractor": "Migrates code with Fractor in dry run mode.", + "ci:php:rector": "Migrates code with Rector in dry run mode.", + "ci:xliff:lint": "Lints the XLIFF files.", + "ci:yaml:lint": "Lints the YAML files.", + "fix:composer:normalize": "Normalizes composer.json file content.", + "fix:php:ecs": "Fixes the code style with easy coding standard.", + "fix:php:fractor": "Migrates code with Fractor.", + "fix:php:rector": "Migrates code with Rector." } } diff --git a/ext_emconf.php b/ext_emconf.php index 6701621..e77017f 100755 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,7 +11,7 @@ 'author_company' => '', 'constraints' => [ 'depends' => [ - 'typo3' => '12.4.0-12.4.99', + 'typo3' => '13.4.0-13.4.99', ], 'conflicts' => [], 'suggests' => [], diff --git a/ext_localconf.php b/ext_localconf.php index 80851f7..1badba5 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,8 +1,8 @@ withPaths([ - __DIR__ . '/Classes', - __DIR__ . '/Configuration', - __DIR__ . '/ext_emconf.php', - __DIR__ . '/ext_localconf.php', - ]) - // uncomment to reach your current PHP version - ->withPhpSets(php81: true) - ->withPhpVersion(PhpVersion::PHP_81) - ->withSets([ - Typo3SetList::CODE_QUALITY, - Typo3SetList::GENERAL, - Typo3LevelSetList::UP_TO_TYPO3_12, - ]) - // To have a better analysis from PHPStan, we teach it here some more things - ->withPHPStanConfigs([ - Typo3Option::PHPSTAN_FOR_RECTOR_PATH, - ]) - ->withRules([ - AddVoidReturnTypeWhereNoReturnRector::class, - ConvertImplicitVariablesToExplicitGlobalsRector::class, - ]) - ->withConfiguredRule(ExtEmConfRector::class, [ - ExtEmConfRector::PHP_VERSION_CONSTRAINT => '8.1.0-8.3.99', - ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '12.4.0-12.4.99', - ExtEmConfRector::ADDITIONAL_VALUES_TO_BE_REMOVED => [], - ]) - // If you use withImportNames(), you should consider excluding some TYPO3 files. - ->withSkip([ - // @see https://github.com/sabbelasichon/typo3-rector/issues/2536 - __DIR__ . '/**/Configuration/ExtensionBuilder/*', - ]) - ->withTypeCoverageLevel(0) -;