Compare commits

...

5 commits

Author SHA1 Message Date
f9553115ee Update 'composer.json' 2018-03-07 13:43:19 +01:00
3276b3fb1e Update 'composer.json' 2018-03-07 13:42:54 +01:00
78610d50ea CI 2017-03-15 00:42:28 +01:00
8ee01fc209 CI 2017-03-15 00:39:46 +01:00
1e6ed3d204 Insight analyse fixes 2017-03-13 15:53:14 +01:00
5 changed files with 5 additions and 7 deletions

2
.gitignore vendored
View file

@ -1,3 +1 @@
*.swp
tags
vendor

View file

@ -20,4 +20,5 @@ 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.

View file

@ -1,7 +1,7 @@
csv-validator
=============
![](https://phpci.gitnet.fr//build-status/image/1)
[![](https://phpci.gitnet.fr/build-status/image/2?branch=master&label=PHPCensor&style=flat-square)](https://phpci.gitnet.fr/build-status/view/2)
CSV validator library

View file

@ -16,7 +16,7 @@
"minimum-stability": "dev",
"require": {
"php": ">=5.6.0",
"symfony/validator": "2.*",
"symfony/validator": "3.*",
"deblan/csv": "v2.0.*"
}
}

View file

@ -2,7 +2,6 @@
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;
@ -23,7 +22,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');
}