Skip to content

Commit 042dcf9

Browse files
nicolassingweaverryan
authored andcommitted
Replace addViolationAt (deprecated) by buildViolation
1 parent 77d166b commit 042dcf9

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

reference/constraints/Callback.rst

+8-12
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,10 @@ those errors should be attributed::
114114

115115
// check if the name is actually a fake name
116116
if (in_array($this->getFirstName(), $fakeNames)) {
117-
$context->addViolationAt(
118-
'firstName',
119-
'This name sounds totally fake!',
120-
array(),
121-
null
122-
);
117+
$context->buildViolation('This name sounds totally fake!')
118+
->atPath('firstName')
119+
->addViolation()
120+
;
123121
}
124122
}
125123
}
@@ -137,12 +135,10 @@ have access to the object instance, they receive the object as the first argumen
137135

138136
// check if the name is actually a fake name
139137
if (in_array($object->getFirstName(), $fakeNames)) {
140-
$context->addViolationAt(
141-
'firstName',
142-
'This name sounds totally fake!',
143-
array(),
144-
null
145-
);
138+
$context->buildViolation('This name sounds totally fake!')
139+
->atPath('firstName')
140+
->addViolation()
141+
;
146142
}
147143
}
148144

0 commit comments

Comments
 (0)