Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Yang Laravel Package

woohoolabs/yang

View on GitHub
Deep Wiki
Context7
3.0.0

ADDED:

  • Support for PSR-18

CHANGED:

  • Increased minimum PHP version requirement to 7.4
  • Declare nearly all property types
  • #34: JsonApiClient implements PSR-18's ClientInterface
  • #33: Use Psr\Http\Client\ClientInterface as type

REMOVED:

  • Support for php-http/httplug v1
  • The deprecated ClassHydrator
  • The deprecated HydratorInterface
3.0.0-rc1

CHANGED:

  • #33: Use Psr\Http\Client\ClientInterface as type
  • Declare nearly all property types

REMOVED:

  • Support for php-http/httplug v1
3.0.0-beta1

ADDED:

  • #34: JsonApiClient implements PSR-18's ClientInterface

CHANGED:

  • Increased minimum PHP version requirement to 7.4
  • PSR-18 is used instead of HTTPlug

REMOVED:

  • The deprecated ClassHydrator has been removed
  • The deprecated HydratorInterface has been removed
2.3.2

ADDED:

  • #31: Allow to set the filter query parameter directly
2.3.1

ADDED:

  • Support for PHP 8
  • Support for PHPUnit 9
2.3.0

ADDED:

  • #28: Introduce AttributeHydratorInterface
2.2.1

FIXED:

  • ClassDocumentHydrator::hydrateSingleResource() returns an object instead of stdClass
2.2.0

ADDED:

  • AbstractClassDocumentHydrator as a base class for custom hydrators

CHANGED:

  • Increased minimum PHP version requirement to 7.2
  • ClassDocumentHydrator is no longer a final class
2.1.0

ADDED:

  • #13: DocumentHydratorInterface and ClassDocumentHydrator in order to fix some issues with the HydratorInterface and ClassHydrator
  • #15: New accessor and mutator methods for WoohooLabs\Yang\JsonApi\Request\ResourceObject: id(), setId(), type(), setType(), attributes(), relationships()

DEPRECATED:

  • HydratorInterface: use the DocumentHydratorInterface instead
  • ClassHydrator: use the ClassDocumentHydrator instead
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 document
    • Document::primaryResource() throws an exception if the document is a collection or error document or the primary resource is missing
    • Document::resource() throws an exception instead of returning null if the requested resource is missing
    • Document::error() throws an exception instead of returning null if the document does not contain the requested error
    • Relationship::resources() throws an exception instead of returning an empty array if the relationship is a to-one
    • Relationship::resource() throws an exception instead of returning null if the relationship is a to-many or empty
    • Relationship::resourceBy() throws an exception instead of returning null if the requested resource is missing
    • ResourceObject::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 to WoohooLabs\Yang\JsonApi\Schema\Error\Error
    • WoohooLabs\Yang\JsonApi\Schema\ErrorSource to WoohooLabs\Yang\JsonApi\Schema\Error\ErrorSource
    • WoohooLabs\Yang\JsonApi\Schema\Link to WoohooLabs\Yang\JsonApi\Schema\Link\Link
    • WoohooLabs\Yang\JsonApi\Schema\ResourceObjects to WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObjects
    • WoohooLabs\Yang\JsonApi\Schema\ResourceObject to WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObject
  • Return separate classes instead of a general Links for the different types of links (BREAKING CHANGE):
    • DocumentLinks when using Document::links()
    • ResourceLinks when using ResourceObject::links()
    • RelationshipLinks when using Relationship::links()
    • ErrorLinks when using Error::links()
  • JsonSerializer::serialize() will throw a RequestException instead of LogicException if the body is of invalid type (BREAKING CHANGE)
  • Rename JsonApi to JsonApiObject (BREAKING CHANGE)
  • Apply the Woohoo Labs. Coding Standard

REMOVED:

  • The generic Link class (BREAKING CHANGE)

FIXED:

  • Issues with 0 when converting to array
2.0.0-beta1

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 default value when using the ResourceObject::attribute() method

CHANGED:

  • Improve type-safety by eliminating null return values (BREAKING):
    • 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 document
    • Document::primaryResource() throws an exception if the document is a collection or error document or the primary resource is missing
    • Document::resource() throws an exception instead of returning null if the requested resource is missing
    • Document::error() throws an exception instead of returning null if the document does not contain the requested error
    • Relationship::resources() throws an exception instead of returning an empty array if the relationship is a to-one
    • Relationship::resource() throws an exception instead of returning null if the relationship is a to-many or empty
    • Relationship::resourceBy() throws an exception instead of returning null if the requested resource is missing
    • ResourceObject::relationship() throws an exception instead of returning null if the requested relationship is missing
  • Move errors, links, and resources to their own namespace (BREAKING):
    • WoohooLabs\Yang\JsonApi\Schema\Error to WoohooLabs\Yang\JsonApi\Schema\Error\Error
    • WoohooLabs\Yang\JsonApi\Schema\ErrorSource to WoohooLabs\Yang\JsonApi\Schema\Error\ErrorSource
    • WoohooLabs\Yang\JsonApi\Schema\Link to WoohooLabs\Yang\JsonApi\Schema\Link\Link
    • WoohooLabs\Yang\JsonApi\Schema\ResourceObjects to WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObjects
    • WoohooLabs\Yang\JsonApi\Schema\ResourceObject to WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObject
  • Return separate classes instead of Links for the different types of links (BREAKING):
    • DocumentLinks when using Document::links()
    • ResourceLinks when using ResourceObject::links()
    • RelationshipLinks when using Relationship::links()
    • ErrorLinks when using Error::links()
  • JsonSerializer::serialize() will throw a RequestException instead of LogicException if the body is of invalid type (BREAKING)
  • Rename JsonApi to JsonApiObject (BREAKING)

REMOVED:

  • The generic Link class (BREAKING)

FIXED:

  • Issues with 0 when converting to array
1.5.0

ADDED:

  • Support for PSR-18 and HTTPlug 2.0

CHANGED:

  • Update PHPUnit to 7.0
1.4.1

ADDED:

  • ClassHydrator::hydrateObject() method
1.4.0

ADDED:

  • Support for hydrating collections via HydratorInterface::hydrateCollection()
1.3.2

FIXED:

  • #9: Resources with an ID of "0" disappear when using ClassHydrator
  • Other issues with "0" affecting ResourceObject::toString() and JsonApiRequestBuilder::toString()
1.3.1

FIXED:

  • #8: Fix for unexpected behaviour when To-One relationship data is null
1.2.1

FIXED:

  • #8: Fix for unexpected behaviour when To-One relationship data is null
1.3.0

CHANGED:

  • Increased minimum PHP version requirement to 7.1
1.2.0

ADDED:

  • Ability to hydrate responses to objects via ClassHydrator
  • Ability to retrieve all relationships of a resource via ResourceObject::getRelationships()
1.1.0

ADDED:

  • #4: Allow relationship's resource identifier objects to have a "meta" value

CHANGED:

  • ToManyRelationship::addResourceIdentifier() uses fluent interface
  • Added missing parameter type declarations
1.0.1

ADDED:

  • ResourceObject::idAndAttributes() method
1.0.0

ADDED:

  • Support for custom serialization
  • Ability to configure the JsonDeserializer

CHANGED:

  • Increased minimum PHP version requirement to 7.0
  • Renamed DefaultDeserializer to JsonDeserializer
  • Moved JsonApiClient and JsonApiAsyncClient into the JsonApi\Client namespace
  • Moved deserializers into the JsonApi\Serializer namespace along with serializers
0.9.0

ADDED:

  • Better support for "about" links

CHANGED:

  • Error::createFromArray() performs more type checks before instantiating an Error object
  • Renamed ErrorSource::fromArray() to ErrorSource::createFromArray()
  • ErrorSource::createFromArray() performs more type checks before instantiating an ErrorSource object
  • Added Relationships::createFromArray() instead of the constructor
  • Renamed Relationship::resourceLink to Relationship::firstResourceLink

FIXED:

  • Representing error status as string as per the spec
0.8.0

CHANGED:

  • Link::createFromArray() performs type checks before instantiating a Link object
  • Added a ResourceObject::createFromArray() instead of the constructor
  • ResourceObject::createFromArray() performs more type checks before instantiating a ResourceObject
  • The "jsonapi" member is always present when using Document::toArray()
  • The "links" member won't be present in a relationship when it is empty when using ResourceObject::toArray()

REMOVED:

  • Links::hasLinks() method
  • JsonApi::hasJsonApi() method

FIXED:

  • The "jsonapi" member was incorrectly recognized as jsonApi
  • If the "jsonapi" member doesn't define the version, "1.0" will be the default now as per the spec
  • Invocation of Links::hasLink() and thus Links::hasSelf() etc. methods resulted in an infinite loop
  • Relationship::toArray() showed the "data" member incorrectly for to-one relationships
0.7.0

ADDED:

  • Added JsonApiResource::setRelationship()
  • Unit tests
  • Docker support to run tests
  • Links::hasAnyLinks() method

CHANGED:

  • Added JsonApiResource::setToOneRelationship() instead of JsonApiResource::setToOneResourceIdentifier()
  • Added JsonApiResource::setToManyRelationship() instead of JsonApiResource::addToManyResourceIdentifier()
  • A Links member won't be present in the data member when it is empty when using Document::toArray()
  • Renamed several methods of ResourceObjects (removed get prefixes)
  • Renamed JsonApiRelationshipInterface class to RelationshipInterface
  • Renamed JsonApiResource class to ResourceObject
  • Renamed JsonApiToManyRelationship class to ToManyRelationship
  • Renamed JsonApiToOneRelationship class to ToOneRelationship

FIXED:

  • JsonApiResource didn't add relationships to the request
  • The type constructor argument became required for JsonApiResource
  • JsonApiRequestBuilder::setPort() didn't do anything
  • JsonApiRequestBuilder::setJsonApi*() methods didn't work as intended
  • JsonApiRequestBuilder::update() will now set the request method to "PATCH" instead of "UPDATE"
  • Error objects are correctly listed under the errors member when using Document::toArray()
  • Correctly transforming included member when using Document::toArray()
  • ResourceObjects::isSingleResourceDocument() Document::isResourceDocument() returned wrong value When data member was null
  • ResourceObjects::hasAnyPrimaryResources() returned wrong value When data member was null
0.6.0

CHANGED:

  • Renamed JsonApiAsyncClient::requestConcurrent() to JsonApiAsyncClient::sendConcurrentAsyncRequests()
  • Renamed Document::hasPrimaryResources() to Docment::hasAnyPrimaryResources()
  • Renamed Document::hasIncludedResources() to Docment::hasAnyIncludedResources()
  • Renamed almost all methods in JsonApiRequestBuilder
  • Do not sort included resources by type and id
  • Improved documentation
0.5.0

ADDED:

  • Support for custom deserialization

CHANGED:

  • Updated minimum PHP version requirement to 5.6
  • Renamed Resource to ResourceObject and Resources to ResourceObjects
0.4.0

ADDED:

  • Support for HTTPlug library to abstract the HTTP client away
  • JsonApiResource::setAttributes() method

CHANGED:

  • Moved asyncronous functionalities of JsonApiClient into JsonApiAsyncClient
  • JsonApiClient::request() method was renamed to JsonApiClient::sendRequest()
  • JsonApiAsyncClient::requestAsync() method was renamed to JsonApiAsyncClient::sendAsyncRequest()

FIXED:

  • Error when serialized response body is apparently empty even though it contains data
0.3.0

ADDED:

  • Ability to define options for JsonApiClient
  • Document::error($number) utility method to retrieve only one error
  • Response::isSuccessful() to determine if the response was successful
  • Response::isSuccessful() to determine if the response was successful and contains a document
  • Support for PHPUnit 5.0

CHANGED:

  • Improved performance

FIXED:

  • PHP version constraint in composer.json
  • If the response didn't contain a valid JSON, Response::document() could have raised a fatal error
  • The type and id weren't included in the request body
  • Empty responses weren't considered successful by JsonApiResponse::isSuccessful()
  • Empty relationship data can now be discovered
  • Sorting does not happen on resource ID
0.2.0

ADDED:

  • Ability to send multiple async requests concurrently
  • Ability to determine the type of documents and relationships

CHANGED:

  • Shortened getter names (removed the "get" prefix)
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
babenkoivan/elastic-client
innmind/static-analysis
innmind/coding-standard
datacore/hub-sdk
alengo/sulu-http-cache-bundle
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php