Skip to content

[Hackday] [2.7] Add a deprecation note about addViolationAt() method #12684

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
javiereguiluz opened this issue Nov 29, 2014 · 2 comments
Closed

Comments

@javiereguiluz
Copy link
Member

NOTE: This issue is part of the "SymfonyCon 2014 Madrid Hackday" effort to add logs for every 2.7 deprecated feature. This is needed before removing those features in 3.0 version. Please, add you name in a comment of this issue if you are going to work on this.

If you need it, this Gist explains how to generate the deprecation note:

https://gist.github.com/javiereguiluz/a5514ec6cde2a63be441


The method addViolationAt() was removed. You should use buildViolation()
instead.

Before:

$context->addViolationAt('property', 'The value {{ value }} is invalid.', array(
   '{{ value }}' => $invalidValue,
));

After:

$context->buildViolation('The value {{ value }} is invalid.')
   ->atPath('property')
   ->setParameter('{{ value }}', $invalidValue)
   ->addViolation();
@beni0888
Copy link

I'll do that

@beni0888
Copy link

@javiereguiluz could you give me more details about the issue, please? The "addViolationAt()" method is implemented in the various classes, so it's quite confusing for me:

  • Symfony\Component\Validator\ExecutionContext.php
  • Symfony\Component\Validator\Context\ExecutionContext.php
  • Symfony\Component\Validator\Context\LegacyExecutionContext.php

fabpot added a commit that referenced this issue Jan 5, 2015
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] adds deprecation notices.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #12608, #12672, #12675 #12684, #12686
| License       | MIT
| Doc PR        | ~

Commits
-------

f9fbb4f Fixes more deprecation notices as per @stof review.
fd47c07 Fixed some deprecations according to @stof feedbacks.
2a3e7d2 Normalizes deprecation notice messages.
738b9be [Validator] fixes UuidValidator deprecated class namespace.
e608ba6 [Form] adds more deprecation notices.
cd9617a [Validator] adds more deprecation notices.
a7f841e [Form] Adds a way to trigger deprecation notice on demand for VirtualFormAwareIterator class.
97efd2c Fixes more deprecation notices.
fd9c7bb Normalized @deprecated annotations.
39cfd47 Removed deprecation notices from test files.
2a9749d Fixes deprecation notices.
6f57b7b Reverted trigger_error() function calls on deprecated interfaces to prevent breaking third party projects implementing them.
86b9f6b Adds deprecation notices for structures to be removed in 3.0.
@fabpot fabpot closed this as completed Jan 5, 2015
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