2.0.0
Changes since beta1:
CHANGED:
- Apply the Woohoo Labs. Coding Standard
Full change set:
ADDED:
- JSON:API 1.1 related features:
- Support for Profiles
- Support for
type
links in errors
Document::errorCount()
to easily count errors in the document- Support for defining a default value when using the
ResourceObject::attribute()
method
CHANGED:
- Improve type-safety by eliminating
null
return values (BREAKING CHANGE):JsonApiResponse::document()
throws an exception instead of returning null if the response doesn't contain a document.Document::primaryResources()
throws an exception if the document is a single-resource or error documentDocument::primaryResource()
throws an exception if the document is a collection or error document or the primary resource is missingDocument::resource()
throws an exception instead of returning null if the requested resource is missingDocument::error()
throws an exception instead of returning null if the document does not contain the requested errorRelationship::resources()
throws an exception instead of returning an empty array if the relationship is a to-oneRelationship::resource()
throws an exception instead of returning null if the relationship is a to-many or emptyRelationship::resourceBy()
throws an exception instead of returning null if the requested resource is missingResourceObject::relationship()
throws an exception instead of returning null if the requested relationship is missing
- Move errors, links, and resources to their own namespace (BREAKING CHANGE):
WoohooLabs\Yang\JsonApi\Schema\Error
toWoohooLabs\Yang\JsonApi\Schema\Error\Error
WoohooLabs\Yang\JsonApi\Schema\ErrorSource
toWoohooLabs\Yang\JsonApi\Schema\Error\ErrorSource
WoohooLabs\Yang\JsonApi\Schema\Link
toWoohooLabs\Yang\JsonApi\Schema\Link\Link
WoohooLabs\Yang\JsonApi\Schema\ResourceObjects
toWoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObjects
WoohooLabs\Yang\JsonApi\Schema\ResourceObject
toWoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObject
- Return separate classes instead of a general
Links
for the different types of links (BREAKING CHANGE):DocumentLinks
when usingDocument::links()
ResourceLinks
when usingResourceObject::links()
RelationshipLinks
when usingRelationship::links()
ErrorLinks
when usingError::links()
JsonSerializer::serialize()
will throw aRequestException
instead ofLogicException
if the body is of invalid type (BREAKING CHANGE)- Rename
JsonApi
toJsonApiObject
(BREAKING CHANGE) - Apply the Woohoo Labs. Coding Standard
REMOVED:
- The generic
Link
class (BREAKING CHANGE)
FIXED:
- Issues with 0 when converting to array