Compare commits

..

3 Commits
1.0.3 ... main

Author SHA1 Message Date
Dorian Contal 5acb21d503 Changement nom README pour affichage dans packagist 2025-05-14 10:53:04 +02:00
Dorian 6853bf95ae Condition si var vide non obligatoire mais regex 2025-05-14 10:46:22 +02:00
Dorian Contal e67eb62e57 Modif readme inclusion yaml et exemple import 2025-04-23 11:52:47 +02:00
2 changed files with 36 additions and 1 deletions

View File

@ -43,6 +43,16 @@ $result = $importService->import(
$logger
);
```
---
## 🧑‍💻 Exemple d'Importation dans le Contrôleur
Dans votre contrôleur ou service, n'oubliez pas d'importer les classes nécessaires pour utiliser le service d'importation :
```php
use Sudalys\ImportService\CsvImportService;
use Sudalys\ImportService\ExcelFileTransformer;
```
---
@ -70,6 +80,21 @@ Géré via `ExcelFileTransformer` :
---
## ⚙️ Configuration du Service dans `services.yaml`
Pour que le service fonctionne correctement dans Symfony, ajoutez la configuration suivante dans votre fichier `services.yaml` :
```yaml
services:
Sudalys\ImportService\:
resource: '../vendor/sudalys/import-service/src/Service/Import/'
autowire: true
autoconfigure: true
public: false
```
---
## 🎓 Exigences
- PHP >= 8.1
@ -82,3 +107,9 @@ Géré via `ExcelFileTransformer` :
MIT

View File

@ -15,7 +15,11 @@ class RegexColumnSpecification implements ColumnSpecificationInterface
public function isSatisfiedBy(string $value): bool
{
return preg_match($this->pattern, $value) === 1;
if(!empty($value) || !trim($value) === '') {
return preg_match($this->pattern, $value) === 1;
}else{
return true;
}
}
public function getErrorMessage(): string