Skip to content

Commit cd29962

Browse files
committed
minor #11463 [Validator] prevent unnecessary calls inside ExecutionContext (Tobion)
This PR was merged into the 2.5 branch. Discussion ---------- [Validator] prevent unnecessary calls inside ExecutionContext | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT Small performance improvement by preventing calls to `PropertyPath::append($this->propertyPath, $subPath)` when not needed. Commits ------- d6d462a [Validator] do not call getter inside ExecutionContext to prevent unnecessary calls
2 parents 7e175ef + d6d462a commit cd29962

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Validator/Context/ExecutionContext.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ public function addViolation($message, array $parameters = array(), $invalidValu
183183
$message,
184184
$parameters,
185185
$this->root,
186-
$this->getPropertyPath(),
187-
$this->getValue(),
186+
$this->propertyPath,
187+
$this->value,
188188
null,
189189
null
190190
));
@@ -200,8 +200,8 @@ public function buildViolation($message, array $parameters = array())
200200
$message,
201201
$parameters,
202202
$this->root,
203-
$this->getPropertyPath(),
204-
$this->getValue(),
203+
$this->propertyPath,
204+
$this->value,
205205
$this->translator,
206206
$this->translationDomain
207207
);

0 commit comments

Comments
 (0)