Skip to content

Commit def047b

Browse files
committed
minor #9469 Propose identical comparison (grelu)
This PR was submitted for the 4.0 branch but it was merged into the 2.7 branch instead (closes #9469). Discussion ---------- Propose identical comparison Hi, I suggest this : the identical comparison is better compared to the eqal comparison. Grégory <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- e095afb Propose identical comparison
2 parents 4dc06e9 + e095afb commit def047b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

best_practices/security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ to the ``Post`` entity that checks if a given user is its author::
177177
*/
178178
public function isAuthor(User $user = null)
179179
{
180-
return $user && $user->getEmail() == $this->getAuthorEmail();
180+
return $user && $user->getEmail() === $this->getAuthorEmail();
181181
}
182182
}
183183

0 commit comments

Comments
 (0)