Skip to content

Commit b9b843b

Browse files
committed
TASK: Remove obsolete special handling for DateTimeInterface
With #4251 `NodeType::getDefaultValuesForProperties` doesnt return a `DateTime` anymore for dateTime default values
1 parent 8ee179a commit b9b843b

3 files changed

Lines changed: 1 addition & 8 deletions

File tree

Neos.ContentRepository.Core/Classes/Feature/NodeModification/Dto/SerializedPropertyValues.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ public static function defaultFromNodeType(NodeType $nodeType, PropertyConverter
7575
{
7676
$values = [];
7777
foreach ($nodeType->getDefaultValuesForProperties() as $propertyName => $defaultValue) {
78-
if ($defaultValue instanceof \DateTimeInterface) {
79-
$defaultValue = json_encode($defaultValue);
80-
}
81-
8278
$propertyType = PropertyType::fromNodeTypeDeclaration(
8379
$nodeType->getPropertyType($propertyName),
8480
PropertyName::fromString($propertyName),

Neos.ContentRepository.Core/Classes/NodeType/NodeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ public function getPropertyType(string $propertyName): string
433433
*
434434
* The default value is configured for each property under the "default" key.
435435
*
436-
* @return array<string,mixed>
436+
* @return array<string,int|float|string|bool|array<int|string,mixed>>
437437
* @api
438438
*/
439439
public function getDefaultValuesForProperties(): array

Neos.ContentRepository.StructureAdjustment/src/Adjustment/PropertyAdjustment.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): \Generat
7777

7878
// detect missing default values
7979
foreach ($nodeType->getDefaultValuesForProperties() as $propertyKey => $defaultValue) {
80-
if ($defaultValue instanceof \DateTimeInterface) {
81-
$defaultValue = json_encode($defaultValue);
82-
}
8380
if (!array_key_exists($propertyKey, $propertyKeysInNode)) {
8481
yield StructureAdjustment::createForNode(
8582
$node,

0 commit comments

Comments
 (0)