Skip to content

Commit 47bcbe0

Browse files
committed
2 parents 987a7b8 + 1ebc9af commit 47bcbe0

File tree

422 files changed

+6868
-2364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

422 files changed

+6868
-2364
lines changed

.github/dependabot.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
version: 2
22
updates:
3-
- package-ecosystem: composer
4-
directory: "/"
5-
schedule:
6-
interval: weekly
7-
time: "09:00"
8-
open-pull-requests-limit: 10
3+
4+
# Maintain dependencies for npm
5+
- package-ecosystem: "npm"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
target-branch: "7.3"
10+
open-pull-requests-limit: 0
11+
labels:
12+
- "security"
13+
14+
# Maintain dependencies for Composer
15+
- package-ecosystem: "composer"
16+
directory: "/"
17+
schedule:
18+
interval: weekly
19+
time: "09:00"
20+
target-branch: "7.3"
21+
open-pull-requests-limit: 10
22+
labels:
23+
- "dependencies"

.github/workflows/add-pr-labels.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Add Labels to Pull Request
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [opened, reopened, synchronize, edited]
66

77
jobs:
@@ -10,6 +10,8 @@ jobs:
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
1315
- name: Maybe remove base branch label
1416
if: github.event.action == 'edited' && github.event.changes.base.ref.from != ''
1517
uses: actions-ecosystem/action-remove-labels@v1

Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private function transformDatasetToHierarchyRelationRecord(array $dataset): arra
226226

227227
return [
228228
'contentstreamid' => $dataset['contentStreamId'],
229-
'dimensionspacepoint' => \json_encode($dimensionSpacePoint),
229+
'dimensionspacepoint' => $dimensionSpacePoint->toJson(),
230230
'dimensionspacepointhash' => $dimensionSpacePoint->hash,
231231
'parentnodeanchor' => $parentNodeAggregateId->isNonExistent()
232232
? Algorithms::generateUUID()
@@ -271,9 +271,9 @@ private function findRelationAnchorPointByIds(
271271
AND h.contentstreamid = :contentStreamId
272272
AND h.dimensionspacepointhash = :dimensionSpacePointHash',
273273
[
274-
'contentStreamId' => (string)$contentStreamId,
274+
'contentStreamId' => $contentStreamId->value,
275275
'dimensionSpacePointHash' => $dimensionSpacePoint->hash,
276-
'nodeAggregateId' => (string)$nodeAggregateId
276+
'nodeAggregateId' => $nodeAggregateId->value
277277
]
278278
)->fetchAssociative();
279279

Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasEnabled;
3434
use Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet;
3535
use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved;
36+
use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\SerializedNodeReference;
3637
use Neos\ContentRepository\Core\Feature\NodeReferencing\Event\NodeReferencesWereSet;
3738
use Neos\ContentRepository\Core\Feature\NodeRemoval\Event\NodeAggregateWasRemoved;
3839
use Neos\ContentRepository\Core\Feature\NodeRenaming\Event\NodeAggregateNameWasChanged;
@@ -336,9 +337,9 @@ private function whenRootNodeAggregateDimensionsWereUpdated(RootNodeAggregateDim
336337
AND childnodeanchor = :childNodeAnchor
337338
AND contentstreamid = :contentStreamId
338339
', [
339-
'parentNodeAnchor' => (string)NodeRelationAnchorPoint::forRootEdge(),
340-
'childNodeAnchor' => (string)$rootNodeAnchorPoint,
341-
'contentStreamId' => (string)$event->contentStreamId
340+
'parentNodeAnchor' => NodeRelationAnchorPoint::forRootEdge()->value,
341+
'childNodeAnchor' => $rootNodeAnchorPoint->value,
342+
'contentStreamId' => $event->contentStreamId->value,
342343
]);
343344
// recreate hierarchy edges for the root node
344345
$this->connectHierarchy(
@@ -399,9 +400,9 @@ private function whenNodeAggregateNameWasChanged(NodeAggregateNameWasChanged $ev
399400
n.nodeaggregateid = :nodeAggregateId
400401
and h.contentstreamid = :contentStreamId
401402
', [
402-
'newName' => (string)$event->newNodeName,
403-
'nodeAggregateId' => (string)$event->nodeAggregateId,
404-
'contentStreamId' => (string)$event->contentStreamId,
403+
'newName' => $event->newNodeName->value,
404+
'nodeAggregateId' => $event->nodeAggregateId->value,
405+
'contentStreamId' => $event->contentStreamId->value,
405406
'lastModified' => $eventEnvelope->recordedAt,
406407
'originalLastModified' => self::initiatingDateTime($eventEnvelope),
407408
], [
@@ -435,18 +436,18 @@ private function connectRestrictionRelationsFromParentNodeToNewlyCreatedNode(
435436
r.contentstreamid,
436437
r.dimensionspacepointhash,
437438
r.originnodeaggregateid,
438-
"' . $newlyCreatedNodeAggregateId . '" as affectednodeaggregateid
439+
"' . $newlyCreatedNodeAggregateId->value . '" as affectednodeaggregateid
439440
FROM
440441
' . $this->tableNamePrefix . '_restrictionrelation r
441442
WHERE
442443
r.contentstreamid = :sourceContentStreamId
443444
and r.dimensionspacepointhash IN (:visibleDimensionSpacePoints)
444445
and r.affectednodeaggregateid = :parentNodeAggregateId
445446
', [
446-
'sourceContentStreamId' => (string)$contentStreamId,
447+
'sourceContentStreamId' => $contentStreamId->value,
447448
'visibleDimensionSpacePoints' => $dimensionSpacePointsInWhichNewlyCreatedNodeAggregateIsVisible
448449
->getPointHashes(),
449-
'parentNodeAggregateId' => (string)$parentNodeAggregateId
450+
'parentNodeAggregateId' => $parentNodeAggregateId->value
450451
], [
451452
'visibleDimensionSpacePoints' => Connection::PARAM_STR_ARRAY
452453
]);
@@ -641,7 +642,7 @@ private function getRelationPositionAfterRecalculation(
641642
$offset += self::RELATION_DEFAULT_OFFSET;
642643
if (
643644
$succeedingSiblingAnchorPoint
644-
&& (string)$relation->childNodeAnchor === (string)$succeedingSiblingAnchorPoint
645+
&& $relation->childNodeAnchor->equals($succeedingSiblingAnchorPoint)
645646
) {
646647
$position = $offset;
647648
$offset += self::RELATION_DEFAULT_OFFSET;
@@ -679,12 +680,12 @@ private function whenContentStreamWasForked(ContentStreamWasForked $event): void
679680
h.position,
680681
h.dimensionspacepoint,
681682
h.dimensionspacepointhash,
682-
"' . $event->newContentStreamId . '" AS contentstreamid
683+
"' . $event->newContentStreamId->value . '" AS contentstreamid
683684
FROM
684685
' . $this->tableNamePrefix . '_hierarchyrelation h
685686
WHERE h.contentstreamid = :sourceContentStreamId
686687
', [
687-
'sourceContentStreamId' => (string)$event->sourceContentStreamId
688+
'sourceContentStreamId' => $event->sourceContentStreamId->value
688689
]);
689690

690691
//
@@ -698,15 +699,15 @@ private function whenContentStreamWasForked(ContentStreamWasForked $event): void
698699
affectednodeaggregateid
699700
)
700701
SELECT
701-
"' . $event->newContentStreamId . '" AS contentstreamid,
702+
"' . $event->newContentStreamId->value . '" AS contentstreamid,
702703
r.dimensionspacepointhash,
703704
r.originnodeaggregateid,
704705
r.affectednodeaggregateid
705706
FROM
706707
' . $this->tableNamePrefix . '_restrictionrelation r
707708
WHERE r.contentstreamid = :sourceContentStreamId
708709
', [
709-
'sourceContentStreamId' => (string)$event->sourceContentStreamId
710+
'sourceContentStreamId' => $event->sourceContentStreamId->value
710711
]);
711712

712713
// NOTE: as reference edges are attached to Relation Anchor Points (and they are lazily copy-on-written),
@@ -724,7 +725,7 @@ private function whenContentStreamWasRemoved(ContentStreamWasRemoved $event): vo
724725
WHERE
725726
contentstreamid = :contentStreamId
726727
', [
727-
'contentStreamId' => (string)$event->contentStreamId
728+
'contentStreamId' => $event->contentStreamId->value
728729
]);
729730

730731
// Drop non-referenced nodes (which do not have a hierarchy relation anymore)
@@ -755,7 +756,7 @@ private function whenContentStreamWasRemoved(ContentStreamWasRemoved $event): vo
755756
WHERE
756757
contentstreamid = :contentStreamId
757758
', [
758-
'contentStreamId' => (string)$event->contentStreamId
759+
'contentStreamId' => $event->contentStreamId->value
759760
]);
760761
});
761762
}
@@ -775,8 +776,8 @@ private function whenNodePropertiesWereSet(NodePropertiesWereSet $event, EventEn
775776
if (is_null($anchorPoint)) {
776777
throw new \InvalidArgumentException(
777778
'Cannot update node with copy on write since no anchor point could be resolved for node '
778-
. $event->getNodeAggregateId() . ' in content stream '
779-
. $event->getContentStreamId(),
779+
. $event->getNodeAggregateId()->value . ' in content stream '
780+
. $event->getContentStreamId()->value,
780781
1645303332
781782
);
782783
}
@@ -812,8 +813,8 @@ private function whenNodeReferencesWereSet(NodeReferencesWereSet $event, EventEn
812813
throw new \InvalidArgumentException(
813814
'Could not apply event of type "' . get_class($event)
814815
. '" since no anchor point could be resolved for node '
815-
. $event->getNodeAggregateId() . ' in content stream '
816-
. $event->getContentStreamId(),
816+
. $event->getNodeAggregateId()->value . ' in content stream '
817+
. $event->getContentStreamId()->value,
817818
1658580583
818819
);
819820
}
@@ -838,18 +839,19 @@ function (NodeRecord $node) use ($eventEnvelope) {
838839

839840
// remove old
840841
$this->getDatabaseConnection()->delete($this->tableNamePrefix . '_referencerelation', [
841-
'nodeanchorpoint' => $nodeAnchorPoint,
842-
'name' => $event->referenceName
842+
'nodeanchorpoint' => $nodeAnchorPoint?->value,
843+
'name' => $event->referenceName->value
843844
]);
844845

845846
// set new
846847
$position = 0;
848+
/** @var SerializedNodeReference $reference */
847849
foreach ($event->references as $reference) {
848850
$this->getDatabaseConnection()->insert($this->tableNamePrefix . '_referencerelation', [
849-
'name' => $event->referenceName,
851+
'name' => $event->referenceName->value,
850852
'position' => $position,
851-
'nodeanchorpoint' => $nodeAnchorPoint,
852-
'destinationnodeaggregateid' => $reference->targetNodeAggregateId,
853+
'nodeanchorpoint' => $nodeAnchorPoint?->value,
854+
'destinationnodeaggregateid' => $reference->targetNodeAggregateId->value,
853855
'properties' => $reference->properties
854856
? \json_encode($reference->properties, JSON_THROW_ON_ERROR)
855857
: null
@@ -917,7 +919,7 @@ private function cascadeRestrictionRelations(
917919
-- create new restriction relations...
918920
-- --------------------------------
919921
SELECT
920-
"' . (string)$contentStreamId . '" as contentstreamid,
922+
"' . $contentStreamId->value . '" as contentstreamid,
921923
tree.dimensionspacepointhash,
922924
originnodeaggregateid,
923925
tree.nodeaggregateid as affectednodeaggregateid
@@ -933,9 +935,9 @@ private function cascadeRestrictionRelations(
933935
) AS joinedrestrictingancestors
934936
',
935937
[
936-
'contentStreamId' => (string)$contentStreamId,
937-
'parentNodeAggregateId' => (string)$parentNodeAggregateId,
938-
'entryNodeAggregateId' => (string)$entryNodeAggregateId,
938+
'contentStreamId' => $contentStreamId->value,
939+
'parentNodeAggregateId' => $parentNodeAggregateId->value,
940+
'entryNodeAggregateId' => $entryNodeAggregateId->value,
939941
'dimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes(),
940942
'affectedDimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes()
941943
],
@@ -1008,7 +1010,7 @@ protected function copyNodeToDimensionSpacePoint(
10081010
$copy = new NodeRecord(
10091011
$copyRelationAnchorPoint,
10101012
$sourceNode->nodeAggregateId,
1011-
$originDimensionSpacePoint->jsonSerialize(),
1013+
$originDimensionSpacePoint->coordinates,
10121014
$originDimensionSpacePoint->hash,
10131015
$sourceNode->properties,
10141016
$sourceNode->nodeTypeName,
@@ -1082,9 +1084,9 @@ private function updateNodeRecordWithCopyOnWrite(
10821084
:originalNodeAnchor IN (h.childnodeanchor, h.parentnodeanchor)
10831085
AND h.contentstreamid = :contentStreamId',
10841086
[
1085-
'newNodeAnchor' => (string)$copiedNode->relationAnchorPoint,
1086-
'originalNodeAnchor' => (string)$anchorPoint,
1087-
'contentStreamId' => (string)$contentStreamIdWhereWriteOccurs
1087+
'newNodeAnchor' => $copiedNode->relationAnchorPoint->value,
1088+
'originalNodeAnchor' => $anchorPoint->value,
1089+
'contentStreamId' => $contentStreamIdWhereWriteOccurs->value,
10881090
]
10891091
);
10901092

@@ -1128,8 +1130,8 @@ private function copyReferenceRelations(
11281130
' . $this->tableNamePrefix . '_referencerelation ref
11291131
WHERE ref.nodeanchorpoint = :sourceNodeAnchorPoint
11301132
', [
1131-
'sourceNodeAnchorPoint' => (string)$sourceRelationAnchorPoint,
1132-
'destinationRelationAnchorPoint' => (string)$destinationRelationAnchorPoint
1133+
'sourceNodeAnchorPoint' => $sourceRelationAnchorPoint->value,
1134+
'destinationRelationAnchorPoint' => $destinationRelationAnchorPoint->value
11331135
]);
11341136
}
11351137

@@ -1154,7 +1156,7 @@ private function whenDimensionSpacePointWasMoved(DimensionSpacePointWasMoved $ev
11541156
',
11551157
[
11561158
'dimensionSpacePointHash' => $event->source->hash,
1157-
'contentStreamId' => (string)$event->contentStreamId
1159+
'contentStreamId' => $event->contentStreamId->value
11581160
]
11591161
);
11601162
while ($res = $rel->fetchAssociative()) {
@@ -1163,7 +1165,7 @@ private function whenDimensionSpacePointWasMoved(DimensionSpacePointWasMoved $ev
11631165
$event->contentStreamId,
11641166
$relationAnchorPoint,
11651167
function (NodeRecord $nodeRecord) use ($event) {
1166-
$nodeRecord->originDimensionSpacePoint = $event->target->jsonSerialize();
1168+
$nodeRecord->originDimensionSpacePoint = $event->target->coordinates;
11671169
$nodeRecord->originDimensionSpacePointHash = $event->target->hash;
11681170
}
11691171
);
@@ -1183,8 +1185,8 @@ function (NodeRecord $nodeRecord) use ($event) {
11831185
[
11841186
'originalDimensionSpacePointHash' => $event->source->hash,
11851187
'newDimensionSpacePointHash' => $event->target->hash,
1186-
'newDimensionSpacePoint' => json_encode($event->target->jsonSerialize()),
1187-
'contentStreamId' => (string)$event->contentStreamId
1188+
'newDimensionSpacePoint' => $event->target->toJson(),
1189+
'contentStreamId' => $event->contentStreamId->value
11881190
]
11891191
);
11901192

@@ -1201,7 +1203,7 @@ function (NodeRecord $nodeRecord) use ($event) {
12011203
[
12021204
'originalDimensionSpacePointHash' => $event->source->hash,
12031205
'newDimensionSpacePointHash' => $event->target->hash,
1204-
'contentStreamId' => (string)$event->contentStreamId
1206+
'contentStreamId' => $event->contentStreamId->value
12051207
]
12061208
);
12071209
});
@@ -1235,10 +1237,10 @@ private function whenDimensionShineThroughWasAdded(DimensionShineThroughWasAdded
12351237
WHERE h.contentstreamid = :contentStreamId
12361238
AND h.dimensionspacepointhash = :sourceDimensionSpacePointHash',
12371239
[
1238-
'contentStreamId' => $event->contentStreamId->jsonSerialize(),
1240+
'contentStreamId' => $event->contentStreamId->value,
12391241
'sourceDimensionSpacePointHash' => $event->source->hash,
12401242
'newDimensionSpacePointHash' => $event->target->hash,
1241-
'newDimensionSpacePoint' => json_encode($event->target->jsonSerialize()),
1243+
'newDimensionSpacePoint' => $event->target->toJson(),
12421244
]
12431245
);
12441246

@@ -1261,7 +1263,7 @@ private function whenDimensionShineThroughWasAdded(DimensionShineThroughWasAdded
12611263
AND r.dimensionspacepointhash = :sourceDimensionSpacePointHash
12621264
12631265
', [
1264-
'contentStreamId' => (string)$event->contentStreamId,
1266+
'contentStreamId' => $event->contentStreamId->value,
12651267
'sourceDimensionSpacePointHash' => $event->source->hash,
12661268
'targetDimensionSpacePointHash' => $event->target->hash
12671269
]);

Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(
3232
public static function graphProjectionTableNamePrefix(
3333
ContentRepositoryId $contentRepositoryId
3434
): string {
35-
return sprintf('cr_%s_p_graph', $contentRepositoryId);
35+
return sprintf('cr_%s_p_graph', $contentRepositoryId->value);
3636
}
3737

3838
public function build(

Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeDisabling.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event):
7676
)
7777
7878
select
79-
"' . $event->contentStreamId . '" as contentstreamid,
79+
"' . $event->contentStreamId->value . '" as contentstreamid,
8080
dimensionspacepointhash,
81-
"' . $event->nodeAggregateId . '" as originnodeaggregateid,
81+
"' . $event->nodeAggregateId->value . '" as originnodeaggregateid,
8282
nodeaggregateid as affectednodeaggregateid
8383
from tree
8484
',
8585
[
86-
'entryNodeAggregateId' => (string)$event->nodeAggregateId,
87-
'contentStreamId' => (string)$event->contentStreamId,
86+
'entryNodeAggregateId' => $event->nodeAggregateId->value,
87+
'contentStreamId' => $event->contentStreamId->value,
8888
'dimensionSpacePointHashes' => $event->affectedDimensionSpacePoints->getPointHashes()
8989
],
9090
[

Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeRemoval.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function removeRelationRecursivelyFromDatabaseIncludingNonReferencedNo
8787
AND h.contentstreamid IS NULL
8888
',
8989
[
90-
'anchorPointForNode' => (string)$ingoingRelation->childNodeAnchor,
90+
'anchorPointForNode' => $ingoingRelation->childNodeAnchor->value,
9191
]
9292
);
9393
}

0 commit comments

Comments
 (0)