diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2014-04-18 22:35:25 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2014-04-18 22:35:25 +0200 |
commit | 28fd9e9e753e8ad7384e0ba7baf0a82ff9c57e42 (patch) | |
tree | de3fe561d214b657a5f638a905427de03d1aa6a2 | |
parent | 67198df5369976c4e615011d443dd2a1836362a6 (diff) | |
parent | 092ef5478bef202a86b53f2ca0cbaa2f43d45594 (diff) | |
download | symfony-security-28fd9e9e753e8ad7384e0ba7baf0a82ff9c57e42.zip symfony-security-28fd9e9e753e8ad7384e0ba7baf0a82ff9c57e42.tar.gz symfony-security-28fd9e9e753e8ad7384e0ba7baf0a82ff9c57e42.tar.bz2 |
minor #10717 unified return null usages (fabpot)
This PR was merged into the 2.3 branch.
Discussion
----------
unified return null usages
| Q | A
| ------------- | ---
| License | MIT
This PR unifies the way we return `null` from a function or method:
* always use `return;` instead of `return null;` (the current code base uses both);
* never use `return;` at the end of a function/method.
Commits
-------
d1d569b unified return null usages
-rw-r--r-- | Acl/Domain/DoctrineAclCache.php | 8 | ||||
-rw-r--r-- | Acl/Domain/ObjectIdentityRetrievalStrategy.php | 2 | ||||
-rw-r--r-- | Acl/Permission/BasicPermissionMap.php | 2 | ||||
-rw-r--r-- | Core/Authentication/Provider/AnonymousAuthenticationProvider.php | 2 | ||||
-rw-r--r-- | Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php | 2 | ||||
-rw-r--r-- | Core/Authentication/Provider/UserAuthenticationProvider.php | 2 | ||||
-rw-r--r-- | Core/User/User.php | 1 | ||||
-rw-r--r-- | Http/Firewall/ContextListener.php | 2 | ||||
-rw-r--r-- | Http/RememberMe/AbstractRememberMeServices.php | 2 |
9 files changed, 10 insertions, 13 deletions
diff --git a/Acl/Domain/DoctrineAclCache.php b/Acl/Domain/DoctrineAclCache.php index b680fb1..9e14af5 100644 --- a/Acl/Domain/DoctrineAclCache.php +++ b/Acl/Domain/DoctrineAclCache.php @@ -96,14 +96,14 @@ class DoctrineAclCache implements AclCacheInterface { $lookupKey = $this->getAliasKeyForIdentity($aclId); if (!$this->cache->contains($lookupKey)) { - return null; + return; } $key = $this->cache->fetch($lookupKey); if (!$this->cache->contains($key)) { $this->cache->delete($lookupKey); - return null; + return; } return $this->unserializeAcl($this->cache->fetch($key)); @@ -116,7 +116,7 @@ class DoctrineAclCache implements AclCacheInterface { $key = $this->getDataKeyByIdentity($oid); if (!$this->cache->contains($key)) { - return null; + return; } return $this->unserializeAcl($this->cache->fetch($key)); @@ -154,7 +154,7 @@ class DoctrineAclCache implements AclCacheInterface $parentAcl = $this->getFromCacheById($parentId); if (null === $parentAcl) { - return null; + return; } $acl->setParentAcl($parentAcl); diff --git a/Acl/Domain/ObjectIdentityRetrievalStrategy.php b/Acl/Domain/ObjectIdentityRetrievalStrategy.php index 7dc552c..fc66856 100644 --- a/Acl/Domain/ObjectIdentityRetrievalStrategy.php +++ b/Acl/Domain/ObjectIdentityRetrievalStrategy.php @@ -29,7 +29,7 @@ class ObjectIdentityRetrievalStrategy implements ObjectIdentityRetrievalStrategy try { return ObjectIdentity::fromDomainObject($domainObject); } catch (InvalidDomainObjectException $failed) { - return null; + return; } } } diff --git a/Acl/Permission/BasicPermissionMap.php b/Acl/Permission/BasicPermissionMap.php index 30d801f..fa3d543 100644 --- a/Acl/Permission/BasicPermissionMap.php +++ b/Acl/Permission/BasicPermissionMap.php @@ -92,7 +92,7 @@ class BasicPermissionMap implements PermissionMapInterface public function getMasks($permission, $object) { if (!isset($this->map[$permission])) { - return null; + return; } return $this->map[$permission]; diff --git a/Core/Authentication/Provider/AnonymousAuthenticationProvider.php b/Core/Authentication/Provider/AnonymousAuthenticationProvider.php index ea91075..7fbbf85 100644 --- a/Core/Authentication/Provider/AnonymousAuthenticationProvider.php +++ b/Core/Authentication/Provider/AnonymousAuthenticationProvider.php @@ -40,7 +40,7 @@ class AnonymousAuthenticationProvider implements AuthenticationProviderInterface public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { - return null; + return; } if ($this->key !== $token->getKey()) { diff --git a/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php b/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php index 3affd78..21ce8d0 100644 --- a/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php +++ b/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php @@ -53,7 +53,7 @@ class PreAuthenticatedAuthenticationProvider implements AuthenticationProviderIn public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { - return null; + return; } if (!$user = $token->getUser()) { diff --git a/Core/Authentication/Provider/UserAuthenticationProvider.php b/Core/Authentication/Provider/UserAuthenticationProvider.php index 14fbdda..3728c01 100644 --- a/Core/Authentication/Provider/UserAuthenticationProvider.php +++ b/Core/Authentication/Provider/UserAuthenticationProvider.php @@ -58,7 +58,7 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { - return null; + return; } $username = $token->getUsername(); diff --git a/Core/User/User.php b/Core/User/User.php index b378e1b..ea2c6a4 100644 --- a/Core/User/User.php +++ b/Core/User/User.php @@ -64,7 +64,6 @@ final class User implements AdvancedUserInterface */ public function getSalt() { - return null; } /** diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php index 60ab3df..c4b0a1e 100644 --- a/Http/Firewall/ContextListener.php +++ b/Http/Firewall/ContextListener.php @@ -171,7 +171,7 @@ class ContextListener implements ListenerInterface $this->logger->warning(sprintf('Username "%s" could not be found.', $notFound->getUsername())); } - return null; + return; } } diff --git a/Http/RememberMe/AbstractRememberMeServices.php b/Http/RememberMe/AbstractRememberMeServices.php index 1e60db0..be84208 100644 --- a/Http/RememberMe/AbstractRememberMeServices.php +++ b/Http/RememberMe/AbstractRememberMeServices.php @@ -142,8 +142,6 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface } $this->cancelCookie($request); - - return null; } /** |