You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method clearly wants to receive the $id value, but when we look at the ResourceIdInvalid-exception class you can see it wants the type of the id instead. When given a incorrect id (for example an integer id 100). It will throw an error because it expected a string.
// WoohooLabs\Yin\JsonApi\Exception\ ResourceIdInvalidpublicfunction__construct(string$type)
{
parent::__construct("The resource ID must be a string instead of $type!", 400);
$this->type = $type;
}
The DefaultExceptionFactory::createResourceIdInvalidException method contains an error.
Source: https://github.com/woohoolabs/yin/blob/master/src/JsonApi/Exception/DefaultExceptionFactory.php#L163-L169
The method clearly wants to receive the $id value, but when we look at the
ResourceIdInvalid
-exception class you can see it wants the type of the id instead. When given a incorrect id (for example an integer id100
). It will throw an error because it expected a string.Source: https://github.com/woohoolabs/yin/blob/master/src/JsonApi/Exception/ResourceIdInvalid.php#L17-L21
This can be solved easily in two ways:
new ResourceIdInvalid(gettype($id));
createResourceIdInvalidException
by adding thegettype
there (Only 4 in this lib it self)Let me know what you think.
The text was updated successfully, but these errors were encountered: