I use security.yml to configure password encryption:
encoders:
Acme\UserBundle\Entity\User:
algorithm: bcrypt
cost: 10
Now I want to update user password in my User Entity so somewhere in Entity\User.php I should have something like:
$this->password = password_hash($password, PASSWORD_DEFAULT, ['cost' => 10]);
But let's imagine that sometimes someone will decide to change for example encryption cost value to 20 and will update security.yml. It's easy to forget about custom encryption code.
Can I use settings from security.yml in my code to make solution more generalized and friendly for changes?