Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain once and for all the use of StaticPropertyMetadata #1118

Merged
merged 1 commit into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first argument here is still null though which will cause the type checking in PHP 7 to fail again

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed in 80aec06

*
* Allows you to replace existing data on the current object element.
*
Expand Down