From fda853d7f45ec0527ae5d09a27a42af7279c97c3 Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Fri, 23 Aug 2019 15:44:22 +0200 Subject: [PATCH] explain once and for all the use of StaticPropertyMetadata. The value has to be specified twice. The first for the actual value, the second is for nullability checks and type auto detection. --- UPGRADING.md | 4 ++-- src/JsonSerializationVisitor.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 00b977c6b..3255b8a06 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -35,7 +35,7 @@ If you are on version `1.x`, it is suggested to migrate directly to `3.0.0` (sin - Removed the abstract classes `GenericSerializationVisitor` and `GenericDeserializationVisitor`. - Removed deprecated method `VisitorInterface::getNavigator`, use `Context::getNavigator` instead - Removed deprecated method `JsonSerializationVisitor::addData`, - use `::visitProperty(new StaticPropertyMetadata('', 'name', 'value'), null)` instead + use `::visitProperty(new StaticPropertyMetadata('', 'name', 'value'), 'value')` instead - Removed Propel and PhpCollection support - Changed default date format from ISO8601 to RFC3339 - Event listeners/handlers class names are case sensitive now @@ -84,7 +84,7 @@ If you are on version `1.x`, it is suggested to migrate directly to `3.0.0` (sin **Deprecations** (will be removed in 3.0) - `JsonSerializationVisitor::setData` will be removed, - use `::visitProperty(new StaticPropertyMetadata('', 'name', 'value'), null)` instead + use `::visitProperty(new StaticPropertyMetadata('', 'name', 'value'), 'value')` instead - `JsonSerializationVisitor::hasData` will be removed - `VisitorInterface` is internal, use `SerializationVisitorInterface` and `DeserializationVisitorInterface` instead - `GraphNavigator` is internal, use `GraphNavigatorInterface` instead diff --git a/src/JsonSerializationVisitor.php b/src/JsonSerializationVisitor.php index 1e0dfcd8f..af8361caa 100644 --- a/src/JsonSerializationVisitor.php +++ b/src/JsonSerializationVisitor.php @@ -166,7 +166,7 @@ public function hasData(string $key): bool } /** - * @deprecated Use visitProperty(new StaticPropertyMetadata(null, 'name', 'value'), null) instead + * @deprecated Use `::visitProperty(new StaticPropertyMetadata(null, 'name', 'value'), 'value')` instead * * Allows you to replace existing data on the current object element. *