From 271f56a4d3b90839919b4a8be495c5d99a31b129 Mon Sep 17 00:00:00 2001 From: Alexander Berl Date: Wed, 5 May 2021 16:42:04 +0200 Subject: [PATCH 1/9] TASK: Enable PHP 8 build --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff71c521b55..a90006431d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.3', '7.4'] + php-versions: ['7.3', '7.4', '8.0'] dependencies: ['highest'] composer-arguments: [''] # to run --ignore-platform-reqs in experimental builds static-analysis: ['no'] @@ -27,8 +27,8 @@ jobs: # experimental: false # dependencies: 'highest' - # Experimental build for PHP 8 - #- php-versions: '8.0' + # Experimental build for PHP nightly + #- php-versions: 'nightly' # composer-arguments: '--ignore-platform-reqs' # static-analysis: 'no' # experimental: true From e212659eeaf32fa88a3883d1be28fada8a793298 Mon Sep 17 00:00:00 2001 From: Alexander Berl Date: Sun, 16 May 2021 16:12:49 +0200 Subject: [PATCH 2/9] TASK: Update dependencies to allow doctrine/common 3.x --- Neos.Media.Browser/composer.json | 2 +- Neos.Media/composer.json | 4 ++-- composer.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Neos.Media.Browser/composer.json b/Neos.Media.Browser/composer.json index 9bdc413af8a..cd532d1adca 100644 --- a/Neos.Media.Browser/composer.json +++ b/Neos.Media.Browser/composer.json @@ -15,7 +15,7 @@ "neos/utility-files": "*", "neos/utility-mediatypes": "*", "neos/error-messages": "*", - "doctrine/common": "^2.7", + "doctrine/common": "^2.7 || ^3.0", "doctrine/orm": "^2.6" }, "autoload": { diff --git a/Neos.Media/composer.json b/Neos.Media/composer.json index 4f758bf834c..74ec98491f0 100644 --- a/Neos.Media/composer.json +++ b/Neos.Media/composer.json @@ -14,7 +14,7 @@ "neos/utility-objecthandling": "*", "neos/utility-arrays": "*", "imagine/imagine": "*", - "doctrine/common": "^2.7", + "doctrine/common": "^2.7 || ^3.0", "doctrine/orm": "^2.6", "doctrine/dbal": "^2.8" }, @@ -123,4 +123,4 @@ "Neos.Flow-20201109224100" ] } -} \ No newline at end of file +} diff --git a/composer.json b/composer.json index b9db417ef25..2f36bec20d2 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "neos/utility-unicode": "*", "neos/utility-mediatypes": "*", "neos/error-messages": "*", - "doctrine/common": "^2.7", + "doctrine/common": "^2.7 || ^3.0", "neos/imagine": "^3.1.0", "imagine/imagine": "*", "doctrine/dbal": "^2.8", From 3c38fcb16814dbe2126f5d69a4d9b39352d868be Mon Sep 17 00:00:00 2001 From: Alexander Berl Date: Sun, 16 May 2021 16:24:56 +0200 Subject: [PATCH 3/9] TASK: Declare PHP8 compatible --- Neos.ContentRepository/composer.json | 4 ++-- Neos.Diff/composer.json | 2 +- Neos.Fusion/composer.json | 2 +- Neos.Media.Browser/composer.json | 2 +- Neos.Media/composer.json | 2 +- Neos.Neos/composer.json | 2 +- Neos.NodeTypes.Form/composer.json | 2 +- Neos.SiteKickstarter/composer.json | 2 +- composer.json | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Neos.ContentRepository/composer.json b/Neos.ContentRepository/composer.json index c1bd62666b4..134bfd5e41c 100644 --- a/Neos.ContentRepository/composer.json +++ b/Neos.ContentRepository/composer.json @@ -6,7 +6,7 @@ "GPL-3.0-or-later" ], "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "neos/flow": "*", "neos/cache": "*", "neos/eel": "*", @@ -126,4 +126,4 @@ "Neos.Flow-20201109224100" ] } -} \ No newline at end of file +} diff --git a/Neos.Diff/composer.json b/Neos.Diff/composer.json index 0da337d1324..880cd4c93a9 100644 --- a/Neos.Diff/composer.json +++ b/Neos.Diff/composer.json @@ -4,7 +4,7 @@ "license": "BSD-3-Clause", "description": "This is a comprehensive library for generating differences between two strings or arrays", "require": { - "php": "^7.3" + "php": "^7.3 || ^8.0" }, "autoload": { "psr-4": { diff --git a/Neos.Fusion/composer.json b/Neos.Fusion/composer.json index 1bfe2c2a6a8..b45903a5e26 100644 --- a/Neos.Fusion/composer.json +++ b/Neos.Fusion/composer.json @@ -6,7 +6,7 @@ "GPL-3.0-or-later" ], "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "neos/flow": "*", "neos/fluid-adaptor": "*", "neos/cache": "*", diff --git a/Neos.Media.Browser/composer.json b/Neos.Media.Browser/composer.json index cd532d1adca..b224454b28e 100644 --- a/Neos.Media.Browser/composer.json +++ b/Neos.Media.Browser/composer.json @@ -6,7 +6,7 @@ "GPL-3.0-or-later" ], "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "neos/media": "self.version", "neos/content-repository": "self.version", "neos/neos": "self.version", diff --git a/Neos.Media/composer.json b/Neos.Media/composer.json index 74ec98491f0..5e0cea78686 100644 --- a/Neos.Media/composer.json +++ b/Neos.Media/composer.json @@ -6,7 +6,7 @@ "GPL-3.0-or-later" ], "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "neos/imagine": "^3.1.0", "neos/flow": "*", "neos/cache": "*", diff --git a/Neos.Neos/composer.json b/Neos.Neos/composer.json index 17a36fb7c96..8240db22e17 100644 --- a/Neos.Neos/composer.json +++ b/Neos.Neos/composer.json @@ -6,7 +6,7 @@ ], "description": "An open source Content Application Platform based on Flow. A set of core Content Management features is resting within a larger context that allows you to build a perfectly customized experience for your users.", "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "neos/diff": "~7.0.0", "neos/flow": "~7.0.0", "neos/media-browser": "~7.0.0", diff --git a/Neos.NodeTypes.Form/composer.json b/Neos.NodeTypes.Form/composer.json index a6afa7af1de..15876766cc7 100644 --- a/Neos.NodeTypes.Form/composer.json +++ b/Neos.NodeTypes.Form/composer.json @@ -6,7 +6,7 @@ "GPL-3.0-or-later" ], "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "neos/neos": "*", "neos/form": "*", "neos/nodetypes-basemixins": "*" diff --git a/Neos.SiteKickstarter/composer.json b/Neos.SiteKickstarter/composer.json index 45dcbf88f0e..53215b2e31d 100755 --- a/Neos.SiteKickstarter/composer.json +++ b/Neos.SiteKickstarter/composer.json @@ -4,7 +4,7 @@ "description": "A simple generator for Neos assets, like sites and plugins.", "license": ["GPL-3.0-or-later"], "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "neos/flow": "*", "neos/utility-files": "*", "neos/fluid-adaptor": "*", diff --git a/composer.json b/composer.json index 2f36bec20d2..24b0303cc96 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "require": { "neos/flow-development-collection": "7.0.x-dev", "neos/neos-setup": "^1.0", - "php": "^7.3", + "php": "^7.3 || ^8.0", "neos/flow": "*", "neos/cache": "*", "neos/eel": "*", From 724300143cfbf09d00a8036a218178891f732b39 Mon Sep 17 00:00:00 2001 From: Michael Gerdemann Date: Tue, 25 May 2021 07:30:51 +0200 Subject: [PATCH 4/9] TASK: Update doctrine namespace Updates the ClassMetadata Namespace from Doctrine\Common\Persistence\Mapping\ClassMetadata to Doctrine\Persistence\Mapping\ClassMetadata. --- .../Doctrine/AssetAssetCollectionConditionGenerator.php | 2 +- .../Privilege/Doctrine/AssetTagConditionGenerator.php | 2 +- .../Doctrine/AssetWithoutAssetCollectionConditionGenerator.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetAssetCollectionConditionGenerator.php b/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetAssetCollectionConditionGenerator.php index ff6b04d1d79..0112b309dfc 100644 --- a/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetAssetCollectionConditionGenerator.php +++ b/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetAssetCollectionConditionGenerator.php @@ -11,7 +11,7 @@ * source code. */ -use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Query\Filter\SQLFilter as DoctrineSqlFilter; use Neos\Flow\Annotations as Flow; diff --git a/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetTagConditionGenerator.php b/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetTagConditionGenerator.php index 0c8c6006715..1a27881dcd8 100644 --- a/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetTagConditionGenerator.php +++ b/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetTagConditionGenerator.php @@ -11,7 +11,7 @@ * source code. */ -use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Query\Filter\SQLFilter as DoctrineSqlFilter; use Neos\Flow\Annotations as Flow; diff --git a/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetWithoutAssetCollectionConditionGenerator.php b/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetWithoutAssetCollectionConditionGenerator.php index 39d622db28c..a786aa8fa24 100644 --- a/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetWithoutAssetCollectionConditionGenerator.php +++ b/Neos.Media/Classes/Security/Authorization/Privilege/Doctrine/AssetWithoutAssetCollectionConditionGenerator.php @@ -11,7 +11,7 @@ * source code. */ -use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Query\Filter\SQLFilter as DoctrineSqlFilter; use Neos\Flow\Annotations as Flow; From c8bb9d8bee36efdd4b3d92869e2523e70d358684 Mon Sep 17 00:00:00 2001 From: Michael Gerdemann Date: Thu, 27 May 2021 13:20:43 +0200 Subject: [PATCH 5/9] TASK: Remove optional parameters Removes optional parameters if they are followed by a mandatory parameter. --- Neos.ContentRepository/Classes/Domain/Model/NodeData.php | 2 +- Neos.Fusion/Classes/Core/Cache/ContentCache.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.ContentRepository/Classes/Domain/Model/NodeData.php b/Neos.ContentRepository/Classes/Domain/Model/NodeData.php index 38159d86e09..631e03f1c89 100644 --- a/Neos.ContentRepository/Classes/Domain/Model/NodeData.php +++ b/Neos.ContentRepository/Classes/Domain/Model/NodeData.php @@ -558,7 +558,7 @@ function ($childNodeData) { * @param array $dimensions * @return integer The number of child nodes */ - public function getNumberOfChildNodes($nodeTypeFilter = null, Workspace $workspace, array $dimensions) + public function getNumberOfChildNodes($nodeTypeFilter, Workspace $workspace, array $dimensions) { return $this->nodeDataRepository->countByParentAndNodeType($this->path, $nodeTypeFilter, $workspace, $dimensions); } diff --git a/Neos.Fusion/Classes/Core/Cache/ContentCache.php b/Neos.Fusion/Classes/Core/Cache/ContentCache.php index cc4e3d1ba89..7d494431422 100644 --- a/Neos.Fusion/Classes/Core/Cache/ContentCache.php +++ b/Neos.Fusion/Classes/Core/Cache/ContentCache.php @@ -157,7 +157,7 @@ public function createUncachedSegment($content, $fusionPath, array $contextVaria * @param string $cacheDiscriminator The evaluated cache discriminator value * @return string The original content, but with additional markers added */ - public function createDynamicCachedSegment($content, $fusionPath, array $contextVariables, array $cacheIdentifierValues, array $tags = [], $lifetime = null, $cacheDiscriminator) + public function createDynamicCachedSegment($content, $fusionPath, array $contextVariables, array $cacheIdentifierValues, array $tags, $lifetime, $cacheDiscriminator) { $metadata = implode(',', $tags); if ($lifetime !== null) { From 013198ad999d0667ab9b55e165fcf6440b8170fa Mon Sep 17 00:00:00 2001 From: Michael Gerdemann Date: Thu, 27 May 2021 13:22:10 +0200 Subject: [PATCH 6/9] =?UTF-8?q?FIX:=20Fix=20=E2=80=9EcreateChildNodesTryTo?= =?UTF-8?q?CreateAllConfiguredChildNodes=E2=80=9C=20Unit=20Test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unit test "createChildNodesTryToCreateAllConfiguredChildNodes" threw an error because it wanted to mock a final class. --- .../Tests/Unit/Domain/Service/NodeServiceTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Neos.ContentRepository/Tests/Unit/Domain/Service/NodeServiceTest.php b/Neos.ContentRepository/Tests/Unit/Domain/Service/NodeServiceTest.php index c62308a7026..4382c4af4b6 100644 --- a/Neos.ContentRepository/Tests/Unit/Domain/Service/NodeServiceTest.php +++ b/Neos.ContentRepository/Tests/Unit/Domain/Service/NodeServiceTest.php @@ -17,6 +17,7 @@ use Neos\ContentRepository\Domain\Model\NodeType; use Neos\ContentRepository\Domain\Service\NodeService; use Neos\ContentRepository\Domain\Service\NodeTypeManager; +use Ramsey\Uuid\Uuid; /** * Testcase for the NodeService @@ -196,7 +197,7 @@ public function createChildNodesTryToCreateAllConfiguredChildNodes() { $nodeService = $this->createNodeService(); - $mockNode = $this->getMockBuilder(Node::class)->disableOriginalConstructor()->getMock(); + $mockNode = $this->getMockBuilder(Node::class)->disableOriginalConstructor()->onlyMethods(['getNodeType', 'createNode', 'getIdentifier'])->getMock(); $mockNodeType = $this->mockNodeType('Neos.ContentRepository.Testing:Content'); $firstChildNodeType = $this->mockNodeType('Neos.ContentRepository.Testing:Content'); @@ -209,6 +210,8 @@ public function createChildNodesTryToCreateAllConfiguredChildNodes() 'second-child-node-name' => $secondChildNodeType ])); + $mockNode->method('getIdentifier')->willReturn(Uuid::uuid4()); + $mockNode->expects(self::once()) ->method('getNodeType') ->will(self::returnValue($mockNodeType)); From 4e3fb45ae578dded241e0d36ca8bf3c69a85bf19 Mon Sep 17 00:00:00 2001 From: Michael Gerdemann Date: Thu, 27 May 2021 13:45:11 +0200 Subject: [PATCH 7/9] FIX: Fix some functional tests Fixes some functional tests for site import and node tests. --- .../Tests/Functional/Domain/NodesTest.php | 16 ++++++++-------- .../Functional/Domain/Service/Fixtures/Sites.xml | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Neos.ContentRepository/Tests/Functional/Domain/NodesTest.php b/Neos.ContentRepository/Tests/Functional/Domain/NodesTest.php index b3a35c39a4c..d34d6f52fe8 100644 --- a/Neos.ContentRepository/Tests/Functional/Domain/NodesTest.php +++ b/Neos.ContentRepository/Tests/Functional/Domain/NodesTest.php @@ -1098,9 +1098,9 @@ public function nodesCanBeCopiedBefore() $childNodes = $rootNode->getChildNodes(); $names = new \stdClass(); $names->names = []; - array_walk($childNodes, function ($value, $key, &$names) { + array_walk($childNodes, function ($value, $key) use (&$names) { $names->names[] = $value->getName(); - }, $names); + }); self::assertSame(['fluss', 'baz', 'flux'], $names->names); } @@ -1119,9 +1119,9 @@ public function nodesCanBeCopiedAfter() $childNodes = $rootNode->getChildNodes(); $names = new \stdClass(); $names->names = []; - array_walk($childNodes, function ($value, $key, &$names) { + array_walk($childNodes, function ($value, $key) use (&$names) { $names->names[] = $value->getName(); - }, $names); + }); self::assertSame(['baz', 'fluss', 'flux'], $names->names); } @@ -1174,9 +1174,9 @@ public function nodesAreCopiedBeforeRecursively() $names = new \stdClass(); $names->names = []; - array_walk($copiedChildNodes, function ($value, $key, &$names) { + array_walk($copiedChildNodes, function ($value, $key) use (&$names) { $names->names[] = $value->getName(); - }, $names); + }); self::assertSame(['capacitor', 'second', 'third'], $names->names); } @@ -1197,9 +1197,9 @@ public function nodesAreCopiedAfterRecursively() $names = new \stdClass(); $names->names = []; - array_walk($copiedChildNodes, function ($value, $key, &$names) { + array_walk($copiedChildNodes, function ($value, $key) use (&$names) { $names->names[] = $value->getName(); - }, $names); + }); self::assertSame(['capacitor', 'second', 'third'], $names->names); } diff --git a/Neos.Neos/Tests/Functional/Domain/Service/Fixtures/Sites.xml b/Neos.Neos/Tests/Functional/Domain/Service/Fixtures/Sites.xml index 1fe73b0d4cd..758e91bfbeb 100644 --- a/Neos.Neos/Tests/Functional/Domain/Service/Fixtures/Sites.xml +++ b/Neos.Neos/Tests/Functional/Domain/Service/Fixtures/Sites.xml @@ -8,8 +8,8 @@ en_US - 2015-02-23T14:09:49+01:00 - 2015-02-23T14:09:49+01:00 + 2015-02-23T14:09:49+00:00 + 2015-02-23T14:09:49+00:00 example.org @@ -20,8 +20,8 @@ en_US - 2015-02-23T14:09:49+01:00 - 2015-02-23T14:09:49+01:00 + 2015-02-23T14:09:49+00:00 + 2015-02-23T14:09:49+00:00 <h1>Home</h1> home @@ -36,8 +36,8 @@ Neos.Neos:Editor Neos.Neos:Administrator - 2015-02-23T14:13:11+01:00 - 2015-02-23T14:13:11+01:00 + 2015-02-23T14:13:11+00:00 + 2015-02-23T14:13:11+00:00 <h1>This node is protected</h1> protected From 00abe693810010f017d3a97d0968bb274f4b9d44 Mon Sep 17 00:00:00 2001 From: Alexander Berl Date: Thu, 10 Jun 2021 10:18:00 +0200 Subject: [PATCH 8/9] TASK: Revert changes to Test Fixture Timezones --- .../Functional/Domain/Service/Fixtures/Sites.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Neos.Neos/Tests/Functional/Domain/Service/Fixtures/Sites.xml b/Neos.Neos/Tests/Functional/Domain/Service/Fixtures/Sites.xml index 758e91bfbeb..1fe73b0d4cd 100644 --- a/Neos.Neos/Tests/Functional/Domain/Service/Fixtures/Sites.xml +++ b/Neos.Neos/Tests/Functional/Domain/Service/Fixtures/Sites.xml @@ -8,8 +8,8 @@ en_US - 2015-02-23T14:09:49+00:00 - 2015-02-23T14:09:49+00:00 + 2015-02-23T14:09:49+01:00 + 2015-02-23T14:09:49+01:00 example.org @@ -20,8 +20,8 @@ en_US - 2015-02-23T14:09:49+00:00 - 2015-02-23T14:09:49+00:00 + 2015-02-23T14:09:49+01:00 + 2015-02-23T14:09:49+01:00 <h1>Home</h1> home @@ -36,8 +36,8 @@ Neos.Neos:Editor Neos.Neos:Administrator - 2015-02-23T14:13:11+00:00 - 2015-02-23T14:13:11+00:00 + 2015-02-23T14:13:11+01:00 + 2015-02-23T14:13:11+01:00 <h1>This node is protected</h1> protected From 1abbad194e00d21d0d20e3dd135936a1acbd0a5a Mon Sep 17 00:00:00 2001 From: Alexander Berl Date: Wed, 23 Jun 2021 23:45:34 +0200 Subject: [PATCH 9/9] TASK: Use Algorithms::generateUUID() --- .../Tests/Unit/Domain/Service/NodeServiceTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.ContentRepository/Tests/Unit/Domain/Service/NodeServiceTest.php b/Neos.ContentRepository/Tests/Unit/Domain/Service/NodeServiceTest.php index 4382c4af4b6..fae6de971ac 100644 --- a/Neos.ContentRepository/Tests/Unit/Domain/Service/NodeServiceTest.php +++ b/Neos.ContentRepository/Tests/Unit/Domain/Service/NodeServiceTest.php @@ -17,7 +17,7 @@ use Neos\ContentRepository\Domain\Model\NodeType; use Neos\ContentRepository\Domain\Service\NodeService; use Neos\ContentRepository\Domain\Service\NodeTypeManager; -use Ramsey\Uuid\Uuid; +use Neos\Flow\Utility\Algorithms; /** * Testcase for the NodeService @@ -210,7 +210,7 @@ public function createChildNodesTryToCreateAllConfiguredChildNodes() 'second-child-node-name' => $secondChildNodeType ])); - $mockNode->method('getIdentifier')->willReturn(Uuid::uuid4()); + $mockNode->method('getIdentifier')->willReturn(Algorithms::generateUUID()); $mockNode->expects(self::once()) ->method('getNodeType')