{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/14559","labels_url":"https://api.github.com/repos/symfony/symfony/issues/14559/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/14559/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/14559/events","html_url":"https://github.com/symfony/symfony/issues/14559","id":73330770,"number":14559,"title":"buildValidation error in PHP 5.3","user":{"login":"markitosgv","id":1706470,"avatar_url":"https://avatars.githubusercontent.com/u/1706470?v=3","gravatar_id":"","url":"https://api.github.com/users/markitosgv","html_url":"https://github.com/markitosgv","followers_url":"https://api.github.com/users/markitosgv/followers","following_url":"https://api.github.com/users/markitosgv/following{/other_user}","gists_url":"https://api.github.com/users/markitosgv/gists{/gist_id}","starred_url":"https://api.github.com/users/markitosgv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markitosgv/subscriptions","organizations_url":"https://api.github.com/users/markitosgv/orgs","repos_url":"https://api.github.com/users/markitosgv/repos","events_url":"https://api.github.com/users/markitosgv/events{/privacy}","received_events_url":"https://api.github.com/users/markitosgv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-05T14:29:16Z","updated_at":"2015-05-05T14:37:19Z","closed_at":null,"body":"Im using Symfony 2.6 and when I try to execute custom validation throw this error:\r\n```\r\nrequest.CRITICAL: Uncaught PHP Exception Symfony\\Component\\Debug\\Exception\\UndefinedMethodException: \"Attempted to call method \"buildViolation\" on class \"Symfony\\Component\\Validator\\ExecutionContext\". Did you mean to call \"addViolation\"?\"\r\n```\r\n\r\nMy code is:\r\n\r\n```php\r\n$this->context->buildViolation($constraint->message)\r\n                    ->setParameter('%text%', $text)\r\n                    ->addViolation();\r\n```\r\n\r\nOnly occurs in production server with PHP 5.3.3 (CentOS), on local machine with Ubuntu and PHP 5.5 works great..."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/99097888","html_url":"https://github.com/symfony/symfony/issues/14559#issuecomment-99097888","issue_url":"https://api.github.com/repos/symfony/symfony/issues/14559","id":99097888,"user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T14:37:19Z","updated_at":"2015-05-05T14:37:19Z","body":"@markitosgv on PHP 5.3.3, the 2.5-BC validation API is not available (it is not compatible with PHP 5.3.8 and below). For such versions, the default configuration is to enable the 2.4 API rather than the 2.5 API (enabling only the 2.5 API is a BC break). And there is no ``buildViolation`` method in the old API.\r\n\r\nIf your code is deployed to PHP 5.3.3, you should force the validation layer to use the 2.4 API version only even locally (and your CI server should run 5.3.3 too, to catch it earlier than the production). However, be careful that Symfony 2.7 does not support PHP 5.3.3 anymore. the min requirement has been bumped to 5.3.9 (this issue is one of the reasons). So you should consider upgrading to a newer PHP version"}}