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

Cannot validate concrete class #58

Closed
shadowhand opened this issue Nov 10, 2018 · 2 comments
Closed

Cannot validate concrete class #58

shadowhand opened this issue Nov 10, 2018 · 2 comments

Comments

@shadowhand
Copy link

shadowhand commented Nov 10, 2018

Because of this constraint it is not possible to validate an object that has a concrete class, even if the class looks something like:

class User
{
    public $id;
    public $username;
    public $email;
}

Shouldn't this constraint be $ok = is_object($data); ?

@vearutop
Copy link
Member

The reason to limit objects to \stdClass was safety and performance of (array)$obj casting, though now I think it is not enough to drop class objects support.

Thank you for pointing the issue.

vearutop added a commit that referenced this issue Nov 11, 2018
#58 add support for native classes as data
@vearutop
Copy link
Member

Fixed in v0.12.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants