summaryrefslogtreecommitdiffstats
path: root/Core/Encoder/EncoderFactory.php
diff options
context:
space:
mode:
authorJohannes Schmitt <schmittjoh@gmail.com>2011-03-07 18:17:46 +0100
committerJohannes M. Schmitt <schmittjoh@gmail.com>2011-03-10 10:25:32 +0100
commitf0335ae722034233c2f49179bc6a9bf8ada62633 (patch)
tree677ee84bc31216f3a7998e62fdc7838a2076fe4c /Core/Encoder/EncoderFactory.php
parentc224430de65547bc9a25293b6a8caf2b9029f05c (diff)
downloadsymfony-security-f0335ae722034233c2f49179bc6a9bf8ada62633.zip
symfony-security-f0335ae722034233c2f49179bc6a9bf8ada62633.tar.gz
symfony-security-f0335ae722034233c2f49179bc6a9bf8ada62633.tar.bz2
[Security] various changes, see below
- visibility changes from protected to private - AccountInterface -> UserInterface - SecurityContext::vote() -> SecurityContext::isGranted()
Diffstat (limited to 'Core/Encoder/EncoderFactory.php')
-rw-r--r--Core/Encoder/EncoderFactory.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/Core/Encoder/EncoderFactory.php b/Core/Encoder/EncoderFactory.php
index 80a7a61..d6441d9 100644
--- a/Core/Encoder/EncoderFactory.php
+++ b/Core/Encoder/EncoderFactory.php
@@ -11,7 +11,7 @@
namespace Symfony\Component\Security\Core\Encoder;
-use Symfony\Component\Security\Core\User\AccountInterface;
+use Symfony\Component\Security\Core\User\UserInterface;
/**
* A generic encoder factory implementation
@@ -20,7 +20,7 @@ use Symfony\Component\Security\Core\User\AccountInterface;
*/
class EncoderFactory implements EncoderFactoryInterface
{
- protected $encoders;
+ private $encoders;
public function __construct(array $encoders)
{
@@ -30,10 +30,10 @@ class EncoderFactory implements EncoderFactoryInterface
/**
* {@inheritDoc}
*/
- public function getEncoder(AccountInterface $account)
+ public function getEncoder(UserInterface $user)
{
foreach ($this->encoders as $class => $encoder) {
- if (!$account instanceof $class) {
+ if (!$user instanceof $class) {
continue;
}
@@ -44,7 +44,7 @@ class EncoderFactory implements EncoderFactoryInterface
return $this->encoders[$class];
}
- throw new \RuntimeException(sprintf('No encoder has been configured for account "%s".', get_class($account)));
+ throw new \RuntimeException(sprintf('No encoder has been configured for account "%s".', get_class($user)));
}
/**
@@ -53,7 +53,7 @@ class EncoderFactory implements EncoderFactoryInterface
* @param array $config
* @return PasswordEncoderInterface
*/
- protected function createEncoder(array $config)
+ private function createEncoder(array $config)
{
if (!isset($config['class'])) {
throw new \InvalidArgumentException(sprintf('"class" must be set in %s.', json_encode($config)));