Thanks to visit codestin.com
Credit goes to github.com

Skip to content

validateProperty notice if no constraint is defined #11604

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

Closed
EmmanuelVella opened this issue Aug 7, 2014 · 2 comments
Closed

validateProperty notice if no constraint is defined #11604

EmmanuelVella opened this issue Aug 7, 2014 · 2 comments

Comments

@EmmanuelVella
Copy link
Contributor

Calling validateProperty on a property which has no constraint defined will result in a notice, when using the 2.5 or 2.5-bc validation API version.

Example :

class Foo
{
    private $bar;

    public function getBar()
    {
        return $this->bar;
    }
} 

$validator->validateProperty($foo, 'bar'); // Undefined index: bar

You can clone my fork and run phpunit to reproduce it : https://github.com/EmmanuelVella/symfony-standard/commit/73565d4a72270be78117ee7c4b71a11865d637c7

@xabbuh
Copy link
Member

xabbuh commented Aug 8, 2014

see #11614

@EmmanuelVella
Copy link
Contributor Author

👍

xabbuh added a commit to xabbuh/symfony that referenced this issue Aug 19, 2014
Adds a test case for symfony#11604 to avoid regressions. The actual issue
has been fixed in Symfony 2.3 with the merge of symfony#11615.
fabpot added a commit that referenced this issue Aug 31, 2014
…straint is defined (xabbuh)

This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Test that validateProperty() works if no constraint is defined

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes (2.3 has to be merged into 2.5 first)
| Fixed tickets | #11604, #11614
| License       | MIT
| Doc PR        |

Adds a test case for #11604 to avoid regressions. The actual issue has been fixed in Symfony 2.3 with the merge of #11615.

Commits
-------

a47a884 add test for #11604
@fabpot fabpot closed this as completed Aug 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants