Commit 7938a260 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Modifs mineures

parent feca088f
Loading
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -63,10 +63,6 @@ abstract class AbstractDatabaseService
     */
    public function initCodeGeneratorFromDestination(): CodeGenerator
    {
        if ($this->destination === null) {
            throw DatabaseServiceException::error("Une destination doit être spécifiée avant l'appel de cette méthode");
        }

        try {
            $platformClass = get_class($this->destination->getConnection()->getDatabasePlatform());
        } catch (Exception $e) {
+6 −3
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ namespace UnicaenDbImport\Service\Facade;

use Doctrine\DBAL\Connection as DbConnection;
use Exception;
use InvalidArgumentException;
use Psr\Log\LoggerAwareTrait;
use stdClass;
use UnicaenApp\Exception\RuntimeException;
@@ -115,7 +116,9 @@ abstract class AbstractFacadeService
     * Requête la Source pour obtenir les données sources.
     * Ces données sont ensuite disponibles dans la Source en question.
     *
     * @throws \Exception
     * @throws \UnicaenDbImport\Service\Exception\DatabaseServiceException
     * @throws \UnicaenDbImport\Service\Exception\ApiServiceException
     *
     * @see SourceInterface::getData()
     */
    public function fetchSource()
@@ -135,7 +138,7 @@ abstract class AbstractFacadeService
                    try {
                        $data = $this->apiService->fetchAll($connection, $this->source);
                    } catch (ApiServiceException $e) {
                        throw new Exception("Erreur rencontrée lors de l'obtention des données sources (API)", null, $e);
                        throw new ApiServiceException("Erreur rencontrée lors de l'obtention des données sources (API)", null, $e);
                    }
                    break;

@@ -148,7 +151,7 @@ abstract class AbstractFacadeService
                    break;

                default:
                    throw new RuntimeException("Type de connexion source inattendue");
                    throw new InvalidArgumentException("Type de connexion source inattendue");
            }

            $this->source->setData($data);
+2 −3
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ class SynchroFacadeService extends AbstractFacadeService
    /**
     * @return int
     * @throws \UnicaenDbImport\Service\Exception\DatabaseServiceException
     * @throws \Exception
     * @throws \UnicaenDbImport\Service\Exception\ApiServiceException
     */
    public function fetchSynchroDiffCount(): int
    {
@@ -130,9 +130,8 @@ class SynchroFacadeService extends AbstractFacadeService
    }

    /**
     * @return SynchroResult
     * @throws \UnicaenDbImport\Service\Exception\DatabaseServiceException
     * @throws \Exception
     * @throws \UnicaenDbImport\Service\Exception\ApiServiceException
     */
    public function synchronizeDestination(): SynchroResult
    {