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
Loading
Loading
Loading
Loading
+12 −25
Original line number Diff line number Diff line
@@ -2,15 +2,13 @@

namespace UnicaenAuth\Authentication\Storage;

use PDOException;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\Authentication\Exception\InvalidArgumentException;
use Doctrine\DBAL\DBALException;
use Zend\Authentication\Storage\Session;
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 Doctrine\DBAL\DBALException;

/**
 * Db authentication storage.
@@ -44,9 +42,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
     *
     * Behavior is undefined when storage is empty.
     *
     * @params ChainEvent $e
     * @throws InvalidArgumentException If reading contents from storage is impossible
     * @return void
     * @param ChainEvent $e
     */
    public function read(ChainEvent $e)
    {
@@ -66,9 +62,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
    /**
     * Writes $contents to storage
     *
     * @params ChainEvent $e
     * @throws \Zend\Authentication\Exception\InvalidArgumentException If writing $contents to storage is impossible
     * @return void
     * @param ChainEvent $e
     */
    public function write(ChainEvent $e)
    {
@@ -81,9 +75,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
    /**
     * Clears contents from storage
     *
     * @params ChainEvent $e
     * @throws \Zend\Authentication\Exception\InvalidArgumentException If clearing contents from storage is impossible
     * @return void
     * @param ChainEvent $e
     */
    public function clear(ChainEvent $e)
    {
@@ -92,7 +84,6 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
    }
    
    /**
     * 
     * @return null
     */
    protected function findIdentity()
@@ -105,6 +96,8 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
            return $id;
        }

        $identity = null;

        /**
         * 1ere tentative :
         * 
@@ -121,9 +114,6 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
            catch (DBALException $dbale) {
                $identity = null;
            }
            catch (PDOException $pdoe) {
                $identity = null;
            }
            catch (ServiceNotFoundException $e) {
                $identity = null;
            }
@@ -145,9 +135,6 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
            catch (DBALException $dbale) {
                $identity = null;
            }
            catch (PDOException $pdoe) {
                $identity = null;
            }
            catch (ServiceNotFoundException $e) {
                $identity = null;
            }
@@ -220,7 +207,7 @@ class Db implements ChainableStorage, ServiceManagerAwareInterface
    /**
     * Set service manager instance
     *
     * @param ServiceManager $locator
     * @param ServiceManager $serviceManager
     * @return self
     */
    public function setServiceManager(ServiceManager $serviceManager)