diff --git a/src/UnicaenAuth/Authentication/Adapter/Cas.php b/src/UnicaenAuth/Authentication/Adapter/Cas.php index c26756803bc9fe5c0c525beab672ea21355c49f5..d1a68de53418b8b1cfa0f4cd148a5447d338a892 100644 --- a/src/UnicaenAuth/Authentication/Adapter/Cas.php +++ b/src/UnicaenAuth/Authentication/Adapter/Cas.php @@ -231,10 +231,7 @@ class Cas extends AbstractAdapter implements EventManagerAwareInterface, Service } /** - * Inject an EventManager instance - * - * @param EventManagerInterface $eventManager - * @return self + * {@inheritdoc} */ public function setEventManager(EventManagerInterface $eventManager) { diff --git a/src/UnicaenAuth/Authentication/Adapter/Ldap.php b/src/UnicaenAuth/Authentication/Adapter/Ldap.php index 162c4f4385ea56c9a9f86e6582cc9966d74755fa..63ca99422f550b9c76824de33544f7eaf076f874 100644 --- a/src/UnicaenAuth/Authentication/Adapter/Ldap.php +++ b/src/UnicaenAuth/Authentication/Adapter/Ldap.php @@ -293,10 +293,7 @@ class Ldap extends AbstractAdapter implements ServiceLocatorAwareInterface, Even } /** - * Inject an EventManager instance - * - * @param EventManagerInterface $eventManager - * @return Ldap + * {@inheritdoc} */ public function setEventManager(EventManagerInterface $eventManager) { diff --git a/src/UnicaenAuth/Authentication/Storage/Chain.php b/src/UnicaenAuth/Authentication/Storage/Chain.php index e6b98179ff0c2377bf75420cd964a04af158e140..377021aed850b8f0d9617c310bc629a257d56edb 100644 --- a/src/UnicaenAuth/Authentication/Storage/Chain.php +++ b/src/UnicaenAuth/Authentication/Storage/Chain.php @@ -139,10 +139,7 @@ class Chain implements StorageInterface, EventManagerAwareInterface } /** - * Inject an EventManager instance - * - * @param EventManagerInterface $eventManager - * @return self + * {@inheritdoc} */ public function setEventManager(EventManagerInterface $eventManager) { diff --git a/src/UnicaenAuth/Entity/Db/AbstractRole.php b/src/UnicaenAuth/Entity/Db/AbstractRole.php index ba211994ecc4210d236d3ec7be70ab67d2d1315b..55f838aee59f41ab352afb171124574bf62c436b 100644 --- a/src/UnicaenAuth/Entity/Db/AbstractRole.php +++ b/src/UnicaenAuth/Entity/Db/AbstractRole.php @@ -189,11 +189,7 @@ abstract class AbstractRole implements RoleInterface } /** - * Add a user to the role. - * - * @param UserInterface $user - * - * @return void + * {@inheritdoc} */ public function addUser(UserInterface $user) { diff --git a/src/UnicaenAuth/Entity/Db/AbstractUser.php b/src/UnicaenAuth/Entity/Db/AbstractUser.php index e463a3a7eaf851d06da83e6004a3c0d16770dc29..39d3ace892961efcc45c560e51fee0180418c89b 100644 --- a/src/UnicaenAuth/Entity/Db/AbstractUser.php +++ b/src/UnicaenAuth/Entity/Db/AbstractUser.php @@ -93,12 +93,13 @@ abstract class AbstractUser implements UserInterface, ProviderInterface * Set id. * * @param int $id - * - * @return void + * @return self */ public function setId($id) { $this->id = (int) $id; + + return $this; } /** @@ -115,12 +116,13 @@ abstract class AbstractUser implements UserInterface, ProviderInterface * Set username. * * @param string $username - * - * @return void + * @return self */ public function setUsername($username) { $this->username = $username; + + return $this; } /** @@ -137,12 +139,13 @@ abstract class AbstractUser implements UserInterface, ProviderInterface * Set email. * * @param string $email - * - * @return void + * @return self */ public function setEmail($email) { $this->email = $email; + + return $this; } /** @@ -159,12 +162,13 @@ abstract class AbstractUser implements UserInterface, ProviderInterface * Set displayName. * * @param string $displayName - * - * @return void + * @return self */ public function setDisplayName($displayName) { $this->displayName = $displayName; + + return $this; } /** @@ -181,12 +185,13 @@ abstract class AbstractUser implements UserInterface, ProviderInterface * Set password. * * @param string $password - * - * @return void + * @return self */ public function setPassword($password) { $this->password = $password; + + return $this; } /** @@ -203,12 +208,13 @@ abstract class AbstractUser implements UserInterface, ProviderInterface * Set state. * * @param int $state - * - * @return void + * @return self */ public function setState($state) { $this->state = $state; + + return $this; } /** @@ -221,10 +227,13 @@ abstract class AbstractUser implements UserInterface, ProviderInterface /** * @param string $passwordResetToken + * @return self */ public function setPasswordResetToken($passwordResetToken = null) { $this->passwordResetToken = $passwordResetToken; + + return $this; } /** @@ -241,12 +250,13 @@ abstract class AbstractUser implements UserInterface, ProviderInterface * Add a role to the user. * * @param RoleInterface $role - * - * @return void + * @return self */ public function addRole(RoleInterface $role) { $this->roles->add($role); + + return $this; } /** diff --git a/src/UnicaenAuth/Entity/Shibboleth/ShibUser.php b/src/UnicaenAuth/Entity/Shibboleth/ShibUser.php index d444b1c4c27e91895e3cecddda93d849660ee73c..8cba0fd40c89b2ef49a9552523008ea009998fd5 100644 --- a/src/UnicaenAuth/Entity/Shibboleth/ShibUser.php +++ b/src/UnicaenAuth/Entity/Shibboleth/ShibUser.php @@ -67,9 +67,7 @@ class ShibUser implements UserInterface } /** - * Get id. - * - * @return string + * {@inheritdoc} */ public function getId() { diff --git a/src/UnicaenAuth/Service/User.php b/src/UnicaenAuth/Service/User.php index bb7f377cdbce938a03c4caa75fcb7e5f029fa987..f32855e50f59ff66810aab248aa69998a3a1e2fc 100644 --- a/src/UnicaenAuth/Service/User.php +++ b/src/UnicaenAuth/Service/User.php @@ -183,10 +183,7 @@ class User implements ServiceLocatorAwareInterface, EventManagerAwareInterface } /** - * Inject an EventManager instance - * - * @param EventManagerInterface $eventManager - * @return self + * {@inheritdoc} */ public function setEventManager(EventManagerInterface $eventManager) { diff --git a/src/UnicaenAuth/Service/UserMapper.php b/src/UnicaenAuth/Service/UserMapper.php index 92cb9b6c1adcd5de53a2494d6b548ce57918a1b3..97c6574bf25ddae42eeb75a3152bd60dc635e8b4 100644 --- a/src/UnicaenAuth/Service/UserMapper.php +++ b/src/UnicaenAuth/Service/UserMapper.php @@ -5,8 +5,7 @@ namespace UnicaenAuth\Service; use Doctrine\ORM\EntityManagerInterface; use UnicaenAuth\Entity\Db\AbstractUser; use UnicaenAuth\Options\ModuleOptions; -use Zend\Hydrator\HydratorInterface; -use ZfcUser\Entity\UserInterface; +use Zend\Stdlib\Hydrator\HydratorInterface; class UserMapper extends \ZfcUser\Mapper\User { @@ -48,12 +47,18 @@ class UserMapper extends \ZfcUser\Mapper\User return $er->find($id); } - public function insert(UserInterface $entity, $tableName = null, HydratorInterface $hydrator = null) + /** + * {@inheritdoc} + */ + public function insert($entity, $tableName = null, HydratorInterface $hydrator = null) { return $this->persist($entity); } - public function update(UserInterface $entity, $where = null, $tableName = null, HydratorInterface $hydrator = null) + /** + * {@inheritdoc} + */ + public function update($entity, $where = null, $tableName = null, HydratorInterface $hydrator = null) { return $this->persist($entity); } diff --git a/src/UnicaenAuth/View/Helper/UserProfileSelectFactory.php b/src/UnicaenAuth/View/Helper/UserProfileSelectFactory.php index ab6fe27fba1a45be423fe9e5c22834a76c60c9bb..570805d44162133f29e4985eec748472ebfd488b 100644 --- a/src/UnicaenAuth/View/Helper/UserProfileSelectFactory.php +++ b/src/UnicaenAuth/View/Helper/UserProfileSelectFactory.php @@ -2,24 +2,27 @@ namespace UnicaenAuth\View\Helper; -use Zend\ServiceManager\ServiceLocatorInterface; +use UnicaenAuth\Service\UserContext; +use Zend\View\HelperPluginManager; /** * Description of UserProfileFactory * * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> */ -class UserProfileSelectFactory extends \UnicaenApp\View\Helper\UserProfileSelectFactory +class UserProfileSelectFactory { /** * Create service * - * @param ServiceLocatorInterface $helperPluginManager - * @return UserProfile + * @param HelperPluginManager $helperPluginManager + * @return UserProfileSelect */ - public function createService(ServiceLocatorInterface $helperPluginManager) + public function createService(HelperPluginManager $helperPluginManager) { $serviceLocator = $helperPluginManager->getServiceLocator(); + + /** @var UserContext $userContextService */ $userContextService = $serviceLocator->get('AuthUserContext'); return new UserProfileSelect($userContextService); diff --git a/src/UnicaenAuth/View/Helper/UserProfileSelectRadioItemFactory.php b/src/UnicaenAuth/View/Helper/UserProfileSelectRadioItemFactory.php index 76454bd81afdef0fc0423927f082280f3cfc03c3..a80a6401e8d73e12696e2f0ee34a4f580a5ff8d9 100644 --- a/src/UnicaenAuth/View/Helper/UserProfileSelectRadioItemFactory.php +++ b/src/UnicaenAuth/View/Helper/UserProfileSelectRadioItemFactory.php @@ -2,24 +2,27 @@ namespace UnicaenAuth\View\Helper; -use Zend\ServiceManager\ServiceLocatorInterface; +use UnicaenAuth\Service\UserContext; +use Zend\View\HelperPluginManager; /** * * * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> */ -class UserProfileSelectRadioItemFactory extends \UnicaenApp\View\Helper\UserProfileSelectFactory +class UserProfileSelectRadioItemFactory { /** * Create service * - * @param ServiceLocatorInterface $helperPluginManager - * @return UserProfile + * @param HelperPluginManager $helperPluginManager + * @return UserProfileSelectRadioItem */ - public function createService(ServiceLocatorInterface $helperPluginManager) + public function createService(HelperPluginManager $helperPluginManager) { $serviceLocator = $helperPluginManager->getServiceLocator(); + + /** @var UserContext $userContextService */ $userContextService = $serviceLocator->get('AuthUserContext'); return new UserProfileSelectRadioItem($userContextService);