Procházet zdrojové kódy

Insight analyse fixes

tags/v2.1.0
Simon Vieille před 2 roky
rodič
revize
1e6ed3d204
3 změnil soubory, kde provedl 3 přidání a 5 odebrání
  1. 0
    2
      .gitignore
  2. 2
    1
      LICENSE
  3. 1
    2
      example.php

+ 0
- 2
.gitignore Zobrazit soubor

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

+ 2
- 1
LICENSE Zobrazit soubor

@@ -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.


+ 1
- 2
example.php Zobrazit soubor

@@ -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');
}

Načítá se…
Zrušit
Uložit