externalisation des import et use du package

This commit is contained in:
Dorian Contal 2025-04-23 11:31:50 +02:00
parent 07fe6226b8
commit 0d3686e34e
19 changed files with 43 additions and 43 deletions

View File

@ -1,15 +1,15 @@
<?php <?php
namespace Sudalys\ImportService; namespace Sudalys\ImportService;
use App\Service\Import\CsvValidator; use Sudalys\ImportService\CsvValidator;
use App\Service\Import\Processor\BasicCsvFileProcessor; use Sudalys\ImportService\Processor\BasicCsvFileProcessor;
use App\Service\Import\Processor\MainProcessor; use Sudalys\ImportService\Processor\MainProcessor;
use App\Service\Import\ErrorHandler\LoggingErrorHandler; use Sudalys\ImportService\ErrorHandler\LoggingErrorHandler;
use App\Service\Import\Specification\ExactHeaderSpecification; use Sudalys\ImportService\Specification\ExactHeaderSpecification;
use App\Service\Import\Specification\RegexColumnSpecification; use Sudalys\ImportService\Specification\RegexColumnSpecification;
use App\Service\Import\Specification\NumericSpecification; use Sudalys\ImportService\Specification\NumericSpecification;
use App\Service\Import\Specification\RequiredColumnSpecification; use Sudalys\ImportService\Specification\RequiredColumnSpecification;
use App\Service\Import\Result\ImportResult; use Sudalys\ImportService\Result\ImportResult;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
class CsvImportService class CsvImportService

View File

@ -2,11 +2,11 @@
namespace Sudalys\ImportService; namespace Sudalys\ImportService;
use App\Service\Import\Interfaces\FileProcessorInterface; use Sudalys\ImportService\Interfaces\FileProcessorInterface;
use App\Service\Import\Interfaces\ValidatorInterface; use Sudalys\ImportService\Interfaces\ValidatorInterface;
use App\Service\Import\Interfaces\ErrorHandlerInterface; use Sudalys\ImportService\Interfaces\ErrorHandlerInterface;
use App\Service\Import\Interfaces\DataProcessorInterface; use Sudalys\ImportService\Interfaces\DataProcessorInterface;
use App\Service\Import\Result\ImportResult; use Sudalys\ImportService\Result\ImportResult;
use function Symfony\Component\DependencyInjection\Loader\Configurator\iterator; use function Symfony\Component\DependencyInjection\Loader\Configurator\iterator;

View File

@ -1,9 +1,9 @@
<?php <?php
namespace Sudalys\ImportService; namespace Sudalys\ImportService;
use App\Service\Import\Interfaces\HeaderSpecificationInterface; use Sudalys\ImportService\Interfaces\HeaderSpecificationInterface;
use App\Service\Import\Result\ValidationResult; use Sudalys\ImportService\Result\ValidationResult;
use App\Service\Import\Interfaces\ValidatorInterface; use Sudalys\ImportService\Interfaces\ValidatorInterface;
class CsvValidator implements ValidatorInterface class CsvValidator implements ValidatorInterface
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Service\Import\ErrorHandler; namespace Sudalys\ImportService\ErrorHandler;
use App\Service\Import\Interfaces\ErrorHandlerInterface; use Sudalys\ImportService\Interfaces\ErrorHandlerInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
class LoggingErrorHandler implements ErrorHandlerInterface class LoggingErrorHandler implements ErrorHandlerInterface

View File

@ -1,5 +1,5 @@
<?php <?php
namespace App\Service\Import\Interfaces; namespace Sudalys\ImportService\Interfaces;
interface ColumnSpecificationInterface interface ColumnSpecificationInterface
{ {
public function isSatisfiedBy(string $value): bool; public function isSatisfiedBy(string $value): bool;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace App\Service\Import\Interfaces; namespace Sudalys\ImportService\Interfaces;
interface DataProcessorInterface interface DataProcessorInterface
{ {

View File

@ -1,5 +1,5 @@
<?php <?php
namespace App\Service\Import\Interfaces; namespace Sudalys\ImportService\Interfaces;
interface ErrorHandlerInterface interface ErrorHandlerInterface
{ {
public function handle(array $errors): void; public function handle(array $errors): void;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace App\Service\Import\Interfaces; namespace Sudalys\ImportService\Interfaces;
interface FileProcessorInterface interface FileProcessorInterface
{ {
public function processFile(string $Path): array; public function processFile(string $Path): array;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace App\Service\Import\Interfaces; namespace Sudalys\ImportService\Interfaces;
interface HeaderSpecificationInterface interface HeaderSpecificationInterface
{ {
public function isSatisfiedBy(array $header): bool; public function isSatisfiedBy(array $header): bool;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Service\Import\Interfaces; namespace Sudalys\ImportService\Interfaces;
use App\Service\Import\Result\ValidationResult; use Sudalys\ImportService\Result\ValidationResult;
interface ValidatorInterface interface ValidatorInterface
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Service\Import\Processor; namespace Sudalys\ImportService\Processor;
use App\Service\Import\Interfaces\FileProcessorInterface; use Sudalys\ImportService\Interfaces\FileProcessorInterface;
use League\Csv\Reader; use League\Csv\Reader;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Service\Import\Processor; namespace Sudalys\ImportService\Processor;
use App\Service\Import\Interfaces\DataProcessorInterface; use Sudalys\ImportService\Interfaces\DataProcessorInterface;
class DatabaseDataProcessor implements DataProcessorInterface class DatabaseDataProcessor implements DataProcessorInterface
{ {

View File

@ -1,9 +1,9 @@
<?php <?php
namespace App\Service\Import\Processor; namespace Sudalys\ImportService\Processor;
use App\Service\Import\Interfaces\DataProcessorInterface; use Sudalys\ImportService\Interfaces\DataProcessorInterface;
//use App\Service\Import\Interfaces\AutreProcessorInterface; // Ajoute d'autres interfaces de traitement si nécessaire //use Sudalys\ImportService\Interfaces\AutreProcessorInterface; // Ajoute d'autres interfaces de traitement si nécessaire
class MainProcessor implements DataProcessorInterface class MainProcessor implements DataProcessorInterface
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Service\Import\Result; namespace Sudalys\ImportService\Result;
class ImportResult class ImportResult
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Service\Import\Result; namespace Sudalys\ImportService\Result;
class ValidationResult class ValidationResult
{ {

View File

@ -1,7 +1,7 @@
<?php <?php
namespace App\Service\Import\Specification; namespace Sudalys\ImportService\Specification;
use App\Service\Import\Interfaces\HeaderSpecificationInterface; use Sudalys\ImportService\Interfaces\HeaderSpecificationInterface;
class ExactHeaderSpecification implements HeaderSpecificationInterface class ExactHeaderSpecification implements HeaderSpecificationInterface
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Service\Import\Specification; namespace Sudalys\ImportService\Specification;
use App\Service\Import\Interfaces\ColumnSpecificationInterface; use Sudalys\ImportService\Interfaces\ColumnSpecificationInterface;
class NumericSpecification implements ColumnSpecificationInterface class NumericSpecification implements ColumnSpecificationInterface
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Service\Import\Specification; namespace Sudalys\ImportService\Specification;
use App\Service\Import\Interfaces\ColumnSpecificationInterface; use Sudalys\ImportService\Interfaces\ColumnSpecificationInterface;
class RegexColumnSpecification implements ColumnSpecificationInterface class RegexColumnSpecification implements ColumnSpecificationInterface
{ {

View File

@ -1,8 +1,8 @@
<?php <?php
namespace App\Service\Import\Specification; namespace Sudalys\ImportService\Specification;
use App\Service\Import\Interfaces\ColumnSpecificationInterface; use Sudalys\ImportService\Interfaces\ColumnSpecificationInterface;
class RequiredColumnSpecification implements ColumnSpecificationInterface class RequiredColumnSpecification implements ColumnSpecificationInterface
{ {