Skip to content

Commit

Permalink
Merge branch 'master' into typo3-12-reactjs
Browse files Browse the repository at this point in the history
# Conflicts:
#	.editorconfig
#	.github/workflows/test-documentation.yml
#	Classes/Parser/NodeFactory.php
#	Documentation/ChangeLog/Index.rst
#	Documentation/guides.xml
#	Resources/Public/jsDomainModeling/extbaseModeling.css
#	Resources/Public/jsDomainModeling/extbaseModeling.scss
#	composer.json
#	ext_emconf.php
#	package-lock.json
  • Loading branch information
Philipp Kuhlmay committed Mar 27, 2024
2 parents ce8f0c0 + 0cb455a commit c962ef1
Show file tree
Hide file tree
Showing 17 changed files with 86 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ indent_size = 4
# Makefile
[{Makefile,**.mk}]
# Use tabs for indentation (Makefiles require tabs)
indent_style = tab
indent_style = tab
11 changes: 6 additions & 5 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand All @@ -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
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/ClassObject/ClassObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Classes/Domain/Model/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 15 additions & 0 deletions Documentation/ChangeLog/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions Documentation/Installation/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------------------------------------

Expand Down
1 change: 0 additions & 1 deletion Tests/BaseFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Service/ParseAndPrintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 14 additions & 0 deletions Tests/Unit/Core/Rendering/RenderingContextFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class RenderingContextFixture implements RenderingContextInterface

public bool $cacheDisabled = false;

public array $attributes = [];

public function __construct()
{
$mockBuilder = new Generator();
Expand Down Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion Tests/Unit/Service/ClassParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Service/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class ParserTest extends BaseUnitTest
{
protected ParserService $parserService;
private ParserService $parserService;

protected function setUp(): void
{
Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions Tests/Unit/Service/PrinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand All @@ -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);
Expand Down
12 changes: 11 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit c962ef1

Please sign in to comment.