diff --git a/.editorconfig b/.editorconfig index c9ee1f81b..131cc534b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -64,4 +64,4 @@ indent_size = 4 # Makefile [{Makefile,**.mk}] # Use tabs for indentation (Makefiles require tabs) -indent_style = tab \ No newline at end of file +indent_style = tab diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 8015afb4b..ef224a87c 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v3 # Runs a single command using the runners shell - - name: Run a one-line script + - name: "Run a one-line script" run: echo This should run the rector test. This is not implemented yet sass-linter: @@ -34,15 +34,16 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - name: "Checkout code" + uses: actions/checkout@v3 - - name: Setup Node + - name: "Setup Node" uses: actions/setup-node@v3 with: node-version: 16.x - - name: Run the "npm ci" command + - name: "Run npm ci" run: npm ci - - name: Run the "npm sass-linter" command + - name: "Run npm sass-linter" run: npm run sass-lint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7187687ba..d90ec3ec2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,6 +11,7 @@ jobs: steps: - name: "Checkout" uses: actions/checkout@v2 + - name: "Publish new version to TER" uses: tomasnorre/typo3-upload-ter@v2 with: diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index d4c6d96a6..b2a6e4f30 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -9,13 +9,13 @@ jobs: name: Check Commit Message runs-on: ubuntu-latest steps: - - name: Check Commit Type + - name: "Check Commit Type" uses: gsactions/commit-message-checker@v1 with: pattern: '^(|\[(!!!|WIP|POC|REVERT)\])\[(BUGFIX|DOCS|FEATURE|SECURITY|TASK|RELEASE|DEVBOX)\] .+($|\n|\r|\n\r)' flags: '' error: 'Your first line has to contain a commit type like "[BUGFIX]" or "[TASK]" or "[FEATURE]" see https://docs.typo3.org/m/typo3/guide-contributionworkflow/master/en-us/Appendix/CommitMessage.html#commitmessage.' - - name: Check Line Length + - name: "Check Line Length" uses: gsactions/commit-message-checker@v1 with: pattern: '^[^#].{1,74}' @@ -27,7 +27,7 @@ jobs: needs: check_commit_message runs-on: ubuntu-latest steps: - - name: Assign and check labels + - name: "Assign and check labels" uses: fuxingloh/multi-labeler@v1 with: config-path: .github/pr-labeler.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bbe7dacac..f20411770 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,34 +22,34 @@ jobs: name: P${{ matrix.php }} - T${{ matrix.typo3 }} steps: - - name: Checkout code + - name: "Checkout code" uses: actions/checkout@v2 - - name: Cache dependencies + - 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 + - name: "Setup PHP" uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl coverage: none - - name: Install dependencies + - name: "Install dependencies" run: composer require "typo3/minimal:${{ matrix.typo3 }}" --prefer-dist --no-progress --no-suggest --no-interaction - - name: Check PHP syntax errors + - 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 - - name: Execute unit tests + - name: "Execute unit tests" run: .Build/bin/phpunit --colors -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml Tests/Unit/ env: TYPO3_PATH_WEB: $PWD/.Build/public - - name: Execute functional tests + - name: "Execute functional tests" run: .Build/bin/phpunit --colors -c .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml Tests/Functional/ env: TYPO3_PATH_WEB: $PWD/.Build/public diff --git a/Classes/Configuration/ExtensionBuilderConfigurationManager.php b/Classes/Configuration/ExtensionBuilderConfigurationManager.php index cf59d6d79..1c59b2cf7 100644 --- a/Classes/Configuration/ExtensionBuilderConfigurationManager.php +++ b/Classes/Configuration/ExtensionBuilderConfigurationManager.php @@ -435,7 +435,10 @@ protected function findModuleIndexByRelationUid( return $result; } - if ($modules[$supposedModuleIndex]['value']['relationGroup']['relations'][$supposedRelationIndex]['uid'] === $uid) { + if ( + isset($modules[$supposedModuleIndex]['value']['relationGroup']['relations'][$supposedRelationIndex]['uid']) + && $modules[$supposedModuleIndex]['value']['relationGroup']['relations'][$supposedRelationIndex]['uid'] === $uid + ) { $result['terminal'] = 'relationWire_' . $supposedRelationIndex; return $result; } diff --git a/Classes/Domain/Model/ClassObject/ClassObject.php b/Classes/Domain/Model/ClassObject/ClassObject.php index fe6ac566f..28435f554 100644 --- a/Classes/Domain/Model/ClassObject/ClassObject.php +++ b/Classes/Domain/Model/ClassObject/ClassObject.php @@ -268,7 +268,7 @@ public function setPropertyTag(string $propertyName, array $tag): void public function propertyExists(string $propertyName): bool { - return is_array($this->methods) && in_array($propertyName, $this->getPropertyNames(), true); + return in_array($propertyName, $this->getPropertyNames(), true); } public function addProperty(Property $classProperty): bool diff --git a/Classes/Domain/Model/Extension.php b/Classes/Domain/Model/Extension.php index 715f16e79..9d4f659c8 100644 --- a/Classes/Domain/Model/Extension.php +++ b/Classes/Domain/Model/Extension.php @@ -292,7 +292,8 @@ public function getClassHierarchy(): ?array if (strpos($parentClass, '\\') === 0) { $parentClass = substr($parentClass, 1); } - if (!is_array($classHierarchy[$parentClass])) { + // Check whether the array key exists + if (!isset($classHierarchy[$parentClass]) || !is_array($classHierarchy[$parentClass])) { $classHierarchy[$parentClass] = []; } $classHierarchy[$parentClass][] = $domainObject; diff --git a/Documentation/ChangeLog/Index.rst b/Documentation/ChangeLog/Index.rst index 2238a096b..4826614da 100644 --- a/Documentation/ChangeLog/Index.rst +++ b/Documentation/ChangeLog/Index.rst @@ -15,6 +15,21 @@ Version 12.0.0 * [DOCS] Update the documentation * [TASK] Removed generation of Tests for the extensions +Version 11.0.13 +--------------- +* [DOCS] Adds information about a possible missing storage path when using composer mode + +Version 11.0.12 +--------------- +* [TASK] Switch documentation rendering to PHP (thanks to Sandra Erbel) +* [BUGFIX] fix issue with default value for nodefactory +* [BUGFIX] Enables scroll view of extension save dialog confirmations (thanks to warki) + +Version 11.0.11 +--------------- +* [TASK] Use current standard for web-dir (thanks to Sybille Peters) +* [BUGFIX] - Undefined array key $parentClass + Version 11.0.10 --------------- * [BUGFIX] Allow null for native date and time diff --git a/Documentation/Installation/Index.rst b/Documentation/Installation/Index.rst index ce9554716..0c44a38f6 100644 --- a/Documentation/Installation/Index.rst +++ b/Documentation/Installation/Index.rst @@ -43,6 +43,19 @@ through: } ] +.. warning:: + + If you are in composer mode, you need to add at least one entry inside "repositories" in your composer.json file. Otherwise the extension_builder will fail to save your extension. The extension_builder will store your generated extension in this folder. + + .. code-block:: php + + "repositories": [ + "local": { + "type": "path", + "url": "Packages/*" + } + ] + Installing the extension prior to TYPO3 11.4 -------------------------------------------- diff --git a/Tests/BaseFunctionalTest.php b/Tests/BaseFunctionalTest.php index 6f4f1869a..c77c7766c 100644 --- a/Tests/BaseFunctionalTest.php +++ b/Tests/BaseFunctionalTest.php @@ -141,7 +141,6 @@ protected function setUp(): void 'codeTemplatePartialPaths', [Environment::getPublicPath() . '/typo3conf/ext/extension_builder/Resources/Private/CodeTemplates/Extbase/Partials'] ); - $this->fileGenerator->_set('enableRoundtrip', true); $this->fileGenerator->_set('extension', $this->extension); } diff --git a/Tests/Functional/Service/ParseAndPrintTest.php b/Tests/Functional/Service/ParseAndPrintTest.php index 837adda55..f1bebac96 100644 --- a/Tests/Functional/Service/ParseAndPrintTest.php +++ b/Tests/Functional/Service/ParseAndPrintTest.php @@ -43,7 +43,7 @@ public function parseAndPrintSimplePropertyClass(): void $this->parseAndPrint('SimpleProperty.php'); } - protected function parseAndPrint(string $fileName, string $subFolder = ''): void + private function parseAndPrint(string $fileName, string $subFolder = ''): void { $classFilePath = $this->fixturesPath . $subFolder . $fileName; self::assertFileExists($classFilePath, 'File not found: ' . $subFolder . $fileName); diff --git a/Tests/Unit/Core/Rendering/RenderingContextFixture.php b/Tests/Unit/Core/Rendering/RenderingContextFixture.php index dad63cb29..fff181426 100644 --- a/Tests/Unit/Core/Rendering/RenderingContextFixture.php +++ b/Tests/Unit/Core/Rendering/RenderingContextFixture.php @@ -65,6 +65,8 @@ class RenderingContextFixture implements RenderingContextInterface public bool $cacheDisabled = false; + public array $attributes = []; + public function __construct() { $mockBuilder = new Generator(); @@ -293,4 +295,16 @@ public function setControllerAction($action): void { $this->controllerAction = $action; } + + public function getAttribute(string $name): ?object + { + return $this->attributes[$name] ?? null; + } + + public function withAttribute(string $name, object $value): RenderingContextInterface + { + $clonedObject = clone $this; + $clonedObject->attributes[$name] = $value; + return $clonedObject; + } } diff --git a/Tests/Unit/Service/ClassParserTest.php b/Tests/Unit/Service/ClassParserTest.php index 49950cf1a..481ed3743 100755 --- a/Tests/Unit/Service/ClassParserTest.php +++ b/Tests/Unit/Service/ClassParserTest.php @@ -153,7 +153,7 @@ public function parseGeneralUtitliy(): void * @throws FileNotFoundException * @throws ReflectionException */ - protected function parseClass($file, $className): ClassObject + private function parseClass($file, $className): ClassObject { $classObject = $this->parserService->parseFile($file)->getFirstClass(); self::assertInstanceOf(ClassObject::class, $classObject); diff --git a/Tests/Unit/Service/ParserTest.php b/Tests/Unit/Service/ParserTest.php index 032f2700f..d9801dfa2 100644 --- a/Tests/Unit/Service/ParserTest.php +++ b/Tests/Unit/Service/ParserTest.php @@ -26,7 +26,7 @@ class ParserTest extends BaseUnitTest { - protected ParserService $parserService; + private ParserService $parserService; protected function setUp(): void { @@ -185,7 +185,7 @@ public function parserFindsAliasDeclarations(): void self::assertSame(count($fileObject->getNamespace()->getAliasDeclarations()), 2, 'Alias declaration not found!'); } - protected function parseFile(string $fileName): File + private function parseFile(string $fileName): File { return $this->parserService->parseFile($this->fixturesPath . $fileName); } diff --git a/Tests/Unit/Service/PrinterTest.php b/Tests/Unit/Service/PrinterTest.php index 5a8e2a94f..72866c01a 100644 --- a/Tests/Unit/Service/PrinterTest.php +++ b/Tests/Unit/Service/PrinterTest.php @@ -295,7 +295,7 @@ public function printsClassMethodWithMultilineParameter(): void $this->compareGeneratedCodeWithOriginal($fileName, $this->tmpDir . $fileName); } - protected function parseAndWrite(string $fileName, string $subFolder = ''): File + private function parseAndWrite(string $fileName, string $subFolder = ''): File { $classFilePath = $this->fixturesPath . $subFolder . $fileName; self::assertFileExists($classFilePath); @@ -313,7 +313,7 @@ protected function parseAndWrite(string $fileName, string $subFolder = ''): File * * @throws ReflectionException */ - protected function compareClasses(File $classFileObject, string $pathToGeneratedFile): ReflectionClass + private function compareClasses(File $classFileObject, string $pathToGeneratedFile): ReflectionClass { self::assertFileExists($pathToGeneratedFile, $pathToGeneratedFile . 'not exists'); $classObject = $classFileObject->getFirstClass(); @@ -340,12 +340,12 @@ class_exists($className), return $reflectedClass; } - protected function parseFile(string $relativeFilePath): File + private function parseFile(string $relativeFilePath): File { return $this->parserService->parseFile($this->fixturesPath . $relativeFilePath); } - protected function compareGeneratedCodeWithOriginal(string $originalFile, string $pathToGeneratedFile): void + private function compareGeneratedCodeWithOriginal(string $originalFile, string $pathToGeneratedFile): void { $originalLines = GeneralUtility::trimExplode(LF, file_get_contents($this->fixturesPath . $originalFile), true); $generatedLines = GeneralUtility::trimExplode(LF, file_get_contents($pathToGeneratedFile), true); diff --git a/composer.json b/composer.json index 2371d8c5e..ca322b1aa 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,17 @@ } }, "scripts": { - "post-autoload-dump": [ + "prepare-release": [ + "rm -rf Resources/Private/Schema", + "rm -rf .devbox", + "rm -rf .editorconfig", + "rm -rf .gitattributes", + "rm -rf .gitignore", + "rm -rf crowdin.yaml", + "rm -rf .php-cs-fixer.php", + "rm -rf .phpstorm.meta.php" + ], + "post-autoload-dump": [ "@prepare-extension-test-structure" ], "prepare-extension-test-structure": [