Browse Source

Insight analyse fixes

Simon Vieille 2 years ago
parent
commit
1e6ed3d204
3 changed files with 3 additions and 5 deletions
  1. 0
    2
      .gitignore
  2. 2
    1
      LICENSE
  3. 1
    2
      example.php

+ 0
- 2
.gitignore View File

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

+ 2
- 1
LICENSE View File

@@ -20,4 +20,5 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 20
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 21
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 22
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+

+ 1
- 2
example.php View File

@@ -2,7 +2,6 @@
2 2
 
3 3
 use Deblan\Csv\CsvParser;
4 4
 use Deblan\CsvValidator\Validator;
5
-use Symfony\Component\Validator\Validation;
6 5
 use Symfony\Component\Validator\Constraints\Email;
7 6
 use Symfony\Component\Validator\Constraints\Date;
8 7
 use Symfony\Component\Validator\Constraints\Callback;
@@ -23,7 +22,7 @@ $validator->addFieldConstraint(1, new Date());
23 22
 $validator->setExpectedHeaders(['foo', 'bar', 'bim']);
24 23
 
25 24
 // An line must contain 3 columns
26
-$validator->addDataConstraint(new Callback(function($data, ExecutionContextInterface $context) {
25
+$validator->addDataConstraint(new Callback(function ($data, ExecutionContextInterface $context) {
27 26
     if (count($data) !== 6) { // 6 because of the legend (3 fields * 2)
28 27
         $context->addViolation('The line must contain 3 columns');
29 28
     }

Loading…
Cancel
Save