From 5913e71f916cf3040704d9d173782177ba25d85c Mon Sep 17 00:00:00 2001 From: Oliver Bartsch Date: Thu, 11 Apr 2024 11:26:09 +0200 Subject: [PATCH] [TASK] Add typo3/coding-standards and .editorconfig --- .editorconfig | 64 ++ .gitignore | 1 + .php-cs-fixer.php | 5 + composer.json | 8 +- composer.lock | 663 +++++++++++++++++- .../psi/Classes/Content/RecordCollector.php | 2 +- .../psi/Classes/Content/RecordEnricher.php | 6 +- .../psi/Classes/Content/ResolvedRecord.php | 5 +- .../PageContentFetchingProcessor.php | 6 +- local_packages/psi/Classes/Domain/Record.php | 11 +- .../ViewHelpers/RenderBlockViewHelper.php | 4 +- .../psi/Configuration/TCA/Overrides/pages.php | 5 +- local_packages/psi/ext_emconf.php | 6 +- 13 files changed, 760 insertions(+), 26 deletions(-) create mode 100644 .editorconfig create mode 100644 .php-cs-fixer.php diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a3e9269 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,64 @@ +# 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 +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +# TS/JS-Files +[*.{ts,js,mjs}] +indent_size = 2 + +# JSON-Files +[*.json] +indent_style = tab + +# ReST-Files +[*.{rst,rst.txt}] +indent_size = 4 +max_line_length = 80 + +# Markdown-Files +[*.md] +max_line_length = 80 + +# YAML-Files +[*.{yaml,yml}] +indent_size = 2 + +# NEON-Files +[*.neon] +indent_size = 2 +indent_style = tab + +# stylelint +[.stylelintrc] +indent_size = 2 + +# package.json +[package.json] +indent_size = 2 + +# TypoScript +[*.{typoscript,tsconfig}] +indent_size = 2 + +# XLF-Files +[*.xlf] +indent_style = tab + +# SQL-Files +[*.sql] +indent_style = tab +indent_size = 2 + +# .htaccess +[{_.htaccess,.htaccess}] +indent_style = tab \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4dd90a2..c1a84c0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ .DS_Store /config/sites /node_modules +.php-cs-fixer.cache diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..732660e --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,5 @@ +getFinder()->in(__DIR__ . '/local_packages'); +return $config; diff --git a/composer.json b/composer.json index 0924639..25194b7 100644 --- a/composer.json +++ b/composer.json @@ -63,7 +63,8 @@ "vlucas/phpdotenv": "^5.6" }, "require-dev": { - "roave/security-advisories": "dev-latest" + "roave/security-advisories": "dev-latest", + "typo3/coding-standards": "^0.8" }, "extra": { "patches": { @@ -71,5 +72,10 @@ "cc410ef": "composer_patches/typo3-cms-core-review-cc410ef.diff" } } + }, + "scripts": { + "cs": [ + "@php bin/php-cs-fixer fix --dry-run --diff --config=./.php-cs-fixer.php local_packages/" + ] } } diff --git a/composer.lock b/composer.lock index 517bd91..9c6ba73 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "afe6c3b56f9821e8157ad883635f8bd7", + "content-hash": "1fb00bf0d1c6fce5b0432f70cb9f8c6c", "packages": [ { "name": "bacon/bacon-qr-code", @@ -7002,6 +7002,317 @@ } ], "packages-dev": [ + { + "name": "composer/pcre", + "version": "3.1.3", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-03-19T10:26:25+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/4f988f8fdf580d53bdb2d1278fe93d1ed5462255", + "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-03-26T18:29:49+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.53.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "69a19093a9ded8d1baac62ed6c009b8bc148d008" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/69a19093a9ded8d1baac62ed6c009b8bc148d008", + "reference": "69a19093a9ded8d1baac62ed6c009b8bc148d008", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", + "infection/infection": "^0.27.11", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.53.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2024-04-08T15:03:00+00:00" + }, { "name": "roave/security-advisories", "version": "dev-latest", @@ -7746,6 +8057,356 @@ } ], "time": "2024-04-03T22:04:54+00:00" + }, + { + "name": "sebastian/diff", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ab83243ecc233de5655b76f577711de9f842e712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ab83243ecc233de5655b76f577711de9f842e712", + "reference": "ab83243ecc233de5655b76f577711de9f842e712", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:30:33+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/process", + "version": "v7.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/0e7727191c3b71ebec6d529fa0e50a01ca5679e9", + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.0.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-02-22T20:27:20+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "983900d6fddf2b0cbaacacbbad07610854bd8112" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/983900d6fddf2b0cbaacacbbad07610854bd8112", + "reference": "983900d6fddf2b0cbaacacbbad07610854bd8112", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.0.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T15:02:46+00:00" + }, + { + "name": "typo3/coding-standards", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/TYPO3/coding-standards.git", + "reference": "27798dd4b8a15d2178260dbd6aad83fb0d6a017e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TYPO3/coding-standards/zipball/27798dd4b8a15d2178260dbd6aad83fb0d6a017e", + "reference": "27798dd4b8a15d2178260dbd6aad83fb0d6a017e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "friendsofphp/php-cs-fixer": "^3.49", + "php": "^8.1", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0" + }, + "require-dev": { + "composer/package-versions-deprecated": "^1.11.99.5", + "ergebnis/composer-normalize": "^2.28", + "keradus/cli-executor": "^1.5", + "maglnet/composer-require-checker": "*", + "nikic/php-parser": "^4.15.5", + "overtrue/phplint": "^9.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.12", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpstan/phpstan-symfony": "^1.3.2", + "phpunit/phpunit": "^10.1.3", + "symfony/finder": ">=5.4", + "symfony/process": ">=5.4" + }, + "default-branch": true, + "bin": [ + "t3-cs", + "typo3-coding-standards" + ], + "type": "coding-standards", + "extra": { + "branch-alias": { + "dev-main": "0.8.x-dev" + } + }, + "autoload": { + "psr-4": { + "TYPO3\\CodingStandards\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Benni Mack", + "email": "benni@typo3.org" + }, + { + "name": "Simon Gilli", + "email": "simon.gilli@typo3.org" + } + ], + "description": "A set of coding guidelines for any TYPO3-related project or extension", + "homepage": "https://typo3.org/", + "keywords": [ + "Code style", + "cms", + "editorconfig", + "php-cs-fixer", + "typo3" + ], + "support": { + "chat": "https://typo3.org/help", + "docs": "https://docs.typo3.org", + "issues": "https://github.com/TYPO3/coding-standards/issues", + "source": "https://github.com/TYPO3/coding-standards" + }, + "time": "2024-02-15T20:27:01+00:00" } ], "aliases": [], diff --git a/local_packages/psi/Classes/Content/RecordCollector.php b/local_packages/psi/Classes/Content/RecordCollector.php index 84dab43..65a4e79 100644 --- a/local_packages/psi/Classes/Content/RecordCollector.php +++ b/local_packages/psi/Classes/Content/RecordCollector.php @@ -44,7 +44,7 @@ public function collect( do { $recordsOnPid = $contentObjectRenderer->getRecords($table, $select); $recordsOnPid = array_map( - function ($record) use ($table) { + function($record) use ($table) { return $this->recordFactory->createFromDatabaseRecord($table, $record); }, $recordsOnPid diff --git a/local_packages/psi/Classes/Content/RecordEnricher.php b/local_packages/psi/Classes/Content/RecordEnricher.php index 7718d00..fe98aa6 100644 --- a/local_packages/psi/Classes/Content/RecordEnricher.php +++ b/local_packages/psi/Classes/Content/RecordEnricher.php @@ -17,12 +17,9 @@ */ class RecordEnricher { - public function __construct( protected readonly RecordFactory $recordFactory - ) - { - } + ) {} public function createResolvedRecordFromRecord(Record $record): ResolvedRecord { @@ -88,5 +85,4 @@ public function createResolvedRecordFromRecord(Record $record): ResolvedRecord } return new ResolvedRecord($record, $resolvedProperties); } - } diff --git a/local_packages/psi/Classes/Content/ResolvedRecord.php b/local_packages/psi/Classes/Content/ResolvedRecord.php index ea9ef07..25f6380 100644 --- a/local_packages/psi/Classes/Content/ResolvedRecord.php +++ b/local_packages/psi/Classes/Content/ResolvedRecord.php @@ -1,4 +1,5 @@ record->getType(); } - public function getRecord(): RecordInterface { + public function getRecord(): RecordInterface + { return $this->record; } @@ -60,5 +62,4 @@ public function offsetUnset(mixed $offset): void { throw new \InvalidArgumentException('Record properties cannot be unset.', 1712139282); } - } diff --git a/local_packages/psi/Classes/DataProcessing/PageContentFetchingProcessor.php b/local_packages/psi/Classes/DataProcessing/PageContentFetchingProcessor.php index 8b12991..d6436b7 100644 --- a/local_packages/psi/Classes/DataProcessing/PageContentFetchingProcessor.php +++ b/local_packages/psi/Classes/DataProcessing/PageContentFetchingProcessor.php @@ -4,11 +4,11 @@ namespace Jacuzzi\Psi\DataProcessing; -use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; -use TYPO3\CMS\Core\Page\PageLayoutResolver; use Jacuzzi\Psi\Content\ContentSlideMode; use Jacuzzi\Psi\Content\RecordCollector; use Jacuzzi\Psi\Content\RecordEnricher; +use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; +use TYPO3\CMS\Core\Page\PageLayoutResolver; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface; @@ -57,7 +57,7 @@ public function process( $cObj, ); if ($processorConfiguration['enrich'] ?? true) { - $items = array_map(fn($item) => $this->recordEnricher->createResolvedRecordFromRecord($item), $items); + $items = array_map(fn ($item) => $this->recordEnricher->createResolvedRecordFromRecord($item), $items); } $contentAreaData['blocks'] = $items; $contentAreaName = $contentAreaData['identifier'] ?? 'column' . $contentAreaData['colPos']; diff --git a/local_packages/psi/Classes/Domain/Record.php b/local_packages/psi/Classes/Domain/Record.php index ea0ef27..e4f5367 100644 --- a/local_packages/psi/Classes/Domain/Record.php +++ b/local_packages/psi/Classes/Domain/Record.php @@ -107,17 +107,18 @@ public function getRawUid(): int return $this->getUid(); } - protected function enhancePropertiesFromRawProperties(array $properties): void { - if(isset($properties['uid'])) { + protected function enhancePropertiesFromRawProperties(array $properties): void + { + if (isset($properties['uid'])) { $this->properties['uid'] = $properties['uid']; } - if(isset($properties['pid'])) { + if (isset($properties['pid'])) { $this->properties['pid'] = $properties['pid']; } - if(isset($properties['_ORIG_uid'])) { + if (isset($properties['_ORIG_uid'])) { $this->properties['_ORIG_uid'] = $properties['_ORIG_uid']; } - if(isset($properties['_LOCALIZED_UID'])) { + if (isset($properties['_LOCALIZED_UID'])) { $this->properties['_LOCALIZED_UID'] = $properties['_LOCALIZED_UID']; } } diff --git a/local_packages/psi/Classes/ViewHelpers/RenderBlockViewHelper.php b/local_packages/psi/Classes/ViewHelpers/RenderBlockViewHelper.php index cb610af..17a483c 100644 --- a/local_packages/psi/Classes/ViewHelpers/RenderBlockViewHelper.php +++ b/local_packages/psi/Classes/ViewHelpers/RenderBlockViewHelper.php @@ -71,12 +71,12 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl $cObjectViewHelper = $view->getViewHelperResolver()->createViewHelperInstance('f', 'cObject'); $blockType = $data->getFullType(); if (str_starts_with($blockType, 'content')) { - $blockType = 'tt_' . $blockType. '.20'; + $blockType = 'tt_' . $blockType . '.20'; } $cObjectViewHelper->setArguments([ 'typoscriptObjectPath' => $blockType, 'data' => $data->getRecord()->getRawRecord()->toArray(), - 'context' => $context + 'context' => $context, ]); $cObjectViewHelper->setRenderingContext($subView->getRenderingContext()); $content = $cObjectViewHelper->render(); diff --git a/local_packages/psi/Configuration/TCA/Overrides/pages.php b/local_packages/psi/Configuration/TCA/Overrides/pages.php index 43ec41b..8635ab4 100644 --- a/local_packages/psi/Configuration/TCA/Overrides/pages.php +++ b/local_packages/psi/Configuration/TCA/Overrides/pages.php @@ -13,12 +13,11 @@ 'config' => [ 'type' => 'file', 'maxitems' => 1, - 'allowed' => 'common-image-types' + 'allowed' => 'common-image-types', ], - ] + ], ]; - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $columns); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'navigation_icon', '1,3,4', 'after:nav_title'); diff --git a/local_packages/psi/ext_emconf.php b/local_packages/psi/ext_emconf.php index 944a48f..6275ae0 100644 --- a/local_packages/psi/ext_emconf.php +++ b/local_packages/psi/ext_emconf.php @@ -13,11 +13,11 @@ 'typo3' => '13.0.0-13.99.99', ], 'conflicts' => [], - 'suggests' => [] + 'suggests' => [], ], 'autoload' => [ 'psr-4' => [ 'Jacuzzi\\Psi\\' => 'Classes/', - ] - ] + ], + ], ];