lamoda/gs1-barcode-validator-rules

This package is abandoned and no longer maintained. No replacement package was suggested.

GS1 Barcode validator rules collection

0.1.1 2019-08-26 07:34 UTC

This package is auto-updated.

Last update: 2023-05-26 16:19:52 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Build Status

Installation

Composer

composer require lamoda/gs1-barcode-validator-rules

Description

This library is a collection of rules for GS1 barcode parser library.

Rules

  1. RussianMarkingCode

Usage

$parser = new \Lamoda\GS1Parser\Parser\Parser(
    Lamoda\GS1BarcodeValidatorRules\RussianMarkingCode::parserConfig();
);

$validatorConfig = new \Lamoda\GS1Parser\Validator\ValidatorConfig();
$validator = new \Lamoda\GS1Parser\Validator\Validator(
    $parser, 
    Lamoda\GS1BarcodeValidatorRules\RussianMarkingCode::validatorConfig()
);

$value = ']d201034531200000111719112510ABCD1234';

$resolution = $validator->validate($value);

if ($resolution->isValid()) {
    // ...
} else {
    var_dump($resolution->getErrors());
}