From 0ee2884b3d027ff1d6701a2028860a7737f85b47 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 30 May 2016 12:02:49 +0200 Subject: [PATCH 1/4] Renaming of method --- README.md | 2 +- example.php | 2 +- src/Deblan/CsvValidator/Validator.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 381aac3..fa1e271 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ $validator->addFieldConstraint(0, new Email()); $validator->addFieldConstraint(1, new Date()); // Validate the legend -$validator->setExceptedLegend(array('foo', 'bar', 'bim')); +$validator->setExpectedLegend(array('foo', 'bar', 'bim')); // An line must contain 3 columns $validator->addDataConstraint(new Callback(function($data, ExecutionContextInterface $context) { diff --git a/example.php b/example.php index 05c5aff..48250f6 100644 --- a/example.php +++ b/example.php @@ -20,7 +20,7 @@ $validator->addFieldConstraint(0, new Email()); $validator->addFieldConstraint(1, new Date()); // Validate the legend -$validator->setExceptedLegend(array('foo', 'bar', 'bim')); +$validator->setExpectedLegend(array('foo', 'bar', 'bim')); // An line must contain 3 columns $validator->addDataConstraint(new Callback(function($data, ExecutionContextInterface $context) { diff --git a/src/Deblan/CsvValidator/Validator.php b/src/Deblan/CsvValidator/Validator.php index 3d0c083..98702cc 100644 --- a/src/Deblan/CsvValidator/Validator.php +++ b/src/Deblan/CsvValidator/Validator.php @@ -98,12 +98,12 @@ class Validator } /** - * Set the excepted legend + * Set the expected legend * * @param array $legend Expected legend * @return Validator */ - public function setExceptedLegend(array $legend) + public function setExpectedLegend(array $legend) { $this->expectedLegend = $legend; From 7ef39038631f5d9260b2628e2b00a1263b4e38e5 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 13 Oct 2016 15:51:11 +0200 Subject: [PATCH 2/4] Packaging --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 258e14b..6493934 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,6 @@ "require": { "php": ">=5.6.0", "symfony/validator": "2.*", - "deblan/csv": "1.1.x-dev" + "deblan/csv": "1.1" } } From 6be22908dc82edc9c92347d492bc6d6df3127321 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 13 Oct 2016 15:53:40 +0200 Subject: [PATCH 3/4] Packaging --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6493934..c9aa77f 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,6 @@ "require": { "php": ">=5.6.0", "symfony/validator": "2.*", - "deblan/csv": "1.1" + "deblan/csv": "v1.1" } } From cbd3ce7e69399c29028363e8852b24a9a4f70439 Mon Sep 17 00:00:00 2001 From: "gautier.deruette" Date: Thu, 1 Dec 2016 11:41:15 +0100 Subject: [PATCH 4/4] =?UTF-8?q?Mettre=20=C3=A0=20jour=20'src/Deblan/CsvVal?= =?UTF-8?q?idator/Validator.php'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Deblan/CsvValidator/Validator.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Deblan/CsvValidator/Validator.php b/src/Deblan/CsvValidator/Validator.php index 98702cc..e6650d0 100644 --- a/src/Deblan/CsvValidator/Validator.php +++ b/src/Deblan/CsvValidator/Validator.php @@ -53,7 +53,6 @@ class Validator /** * Constructor * - * @param CsvParser $parser * @param RecursiveValidator $validator */ public function __construct(RecursiveValidator $validator = null) @@ -68,7 +67,7 @@ class Validator /** * Append a constraint to a specific column * - * @param $key The column number + * @param integer $key The column number * @param Constraint $constraint The constraint * @return Validator */ @@ -86,7 +85,6 @@ class Validator /** * Append a constraint to a specific line * - * @param $key The column number * @param Constraint $constraint The constraint * @return Validator */ @@ -112,6 +110,7 @@ class Validator /** * Run the validation + * @param CsvParser $parser */ public function validate(CsvParser $parser) { @@ -161,7 +160,7 @@ class Validator foreach ($this->parser->getDatas() as $line => $data) { foreach ($this->dataConstraints as $constraint) { - $violations = $this->validator->validateValue($data, $constraint); + $violations = $this->validator->validate($data, $constraint); $this->mergeViolationsMessages($violations, $this->getTrueLine($line)); } @@ -188,7 +187,7 @@ class Validator ); } else { foreach ($constraints as $constraint) { - $violations = $this->validator->validateValue($data[$key], $constraint); + $violations = $this->validator->validate($data[$key], $constraint); $this->mergeViolationsMessages( $violations,