Skip to content

Commit

Permalink
explain once and for all the use of StaticPropertyMetadata.
Browse files Browse the repository at this point in the history
The value has to be specified twice. The first for the actual value, the second is for nullability checks and type auto detection.
  • Loading branch information
goetas committed Aug 23, 2019
1 parent 1792fe2 commit fda853d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/JsonSerializationVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit fda853d

Please sign in to comment.