diff --git a/.gitignore b/.gitignore index 22d0d82..3e52175 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ +*.swp +tags vendor diff --git a/LICENSE b/LICENSE index 80445fb..b57a6c2 100644 --- a/LICENSE +++ b/LICENSE @@ -20,5 +20,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index a83c640..3b2a3d3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ csv-validator ============= -[![](https://phpci.gitnet.fr/build-status/image/2?branch=master&label=PHPCensor&style=flat-square)](https://phpci.gitnet.fr/build-status/view/2) +![](https://phpci.gitnet.fr//build-status/image/1) CSV validator library diff --git a/composer.json b/composer.json index 4e561ff..4e8a836 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "minimum-stability": "dev", "require": { "php": ">=5.6.0", - "symfony/validator": "3.*", + "symfony/validator": "2.*", "deblan/csv": "v2.0.*" } } diff --git a/example.php b/example.php index e764726..595e5c5 100644 --- a/example.php +++ b/example.php @@ -2,6 +2,7 @@ use Deblan\Csv\CsvParser; use Deblan\CsvValidator\Validator; +use Symfony\Component\Validator\Validation; use Symfony\Component\Validator\Constraints\Email; use Symfony\Component\Validator\Constraints\Date; use Symfony\Component\Validator\Constraints\Callback; @@ -22,7 +23,7 @@ $validator->addFieldConstraint(1, new Date()); $validator->setExpectedHeaders(['foo', 'bar', 'bim']); // An line must contain 3 columns -$validator->addDataConstraint(new Callback(function ($data, ExecutionContextInterface $context) { +$validator->addDataConstraint(new Callback(function($data, ExecutionContextInterface $context) { if (count($data) !== 6) { // 6 because of the legend (3 fields * 2) $context->addViolation('The line must contain 3 columns'); }