Commit 0f113d26 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Adapter Db: suppression catch exception inexistante ; correction doc ; ajout...

Adapter Db: suppression catch exception inexistante ; correction doc ; ajout initialisation de variable manquante.
parent c7e0f5e5
Pipeline #3446 failed with stages
in 2 minutes and 1 second
...@@ -2,15 +2,13 @@ ...@@ -2,15 +2,13 @@
namespace UnicaenAuth\Authentication\Storage; namespace UnicaenAuth\Authentication\Storage;
use PDOException; use Doctrine\DBAL\DBALException;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\Authentication\Exception\InvalidArgumentException;
use Zend\Authentication\Storage\Session; use Zend\Authentication\Storage\Session;
use Zend\Authentication\Storage\StorageInterface; use Zend\Authentication\Storage\StorageInterface;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use ZfcUser\Mapper\UserInterface as UserMapper; use ZfcUser\Mapper\UserInterface as UserMapper;
use Doctrine\DBAL\DBALException;
/** /**
* Db authentication storage. * Db authentication storage.
...@@ -38,15 +36,13 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface ...@@ -38,15 +36,13 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
* @var ServiceManager * @var ServiceManager
*/ */
protected $serviceManager; protected $serviceManager;
/** /**
* Returns the contents of storage * Returns the contents of storage
* *
* Behavior is undefined when storage is empty. * Behavior is undefined when storage is empty.
* *
* @params ChainEvent $e * @param ChainEvent $e
* @throws InvalidArgumentException If reading contents from storage is impossible
* @return void
*/ */
public function read(ChainEvent $e) public function read(ChainEvent $e)
{ {
...@@ -66,9 +62,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface ...@@ -66,9 +62,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
/** /**
* Writes $contents to storage * Writes $contents to storage
* *
* @params ChainEvent $e * @param ChainEvent $e
* @throws \Zend\Authentication\Exception\InvalidArgumentException If writing $contents to storage is impossible
* @return void
*/ */
public function write(ChainEvent $e) public function write(ChainEvent $e)
{ {
...@@ -81,9 +75,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface ...@@ -81,9 +75,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
/** /**
* Clears contents from storage * Clears contents from storage
* *
* @params ChainEvent $e * @param ChainEvent $e
* @throws \Zend\Authentication\Exception\InvalidArgumentException If clearing contents from storage is impossible
* @return void
*/ */
public function clear(ChainEvent $e) public function clear(ChainEvent $e)
{ {
...@@ -92,7 +84,6 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface ...@@ -92,7 +84,6 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
} }
/** /**
*
* @return null * @return null
*/ */
protected function findIdentity() protected function findIdentity()
...@@ -104,7 +95,9 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface ...@@ -104,7 +95,9 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
if ($id && !is_scalar($id)) { if ($id && !is_scalar($id)) {
return $id; return $id;
} }
$identity = null;
/** /**
* 1ere tentative : * 1ere tentative :
* *
...@@ -121,9 +114,6 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface ...@@ -121,9 +114,6 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
catch (DBALException $dbale) { catch (DBALException $dbale) {
$identity = null; $identity = null;
} }
catch (PDOException $pdoe) {
$identity = null;
}
catch (ServiceNotFoundException $e) { catch (ServiceNotFoundException $e) {
$identity = null; $identity = null;
} }
...@@ -145,9 +135,6 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface ...@@ -145,9 +135,6 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
catch (DBALException $dbale) { catch (DBALException $dbale) {
$identity = null; $identity = null;
} }
catch (PDOException $pdoe) {
$identity = null;
}
catch (ServiceNotFoundException $e) { catch (ServiceNotFoundException $e) {
$identity = null; $identity = null;
} }
...@@ -220,7 +207,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface ...@@ -220,7 +207,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
/** /**
* Set service manager instance * Set service manager instance
* *
* @param ServiceManager $locator * @param ServiceManager $serviceManager
* @return self * @return self
*/ */
public function setServiceManager(ServiceManager $serviceManager) public function setServiceManager(ServiceManager $serviceManager)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment