composer require lamoda/gs1-barcode-validator-rules
This library is a collection of rules for GS1 barcode parser library.
- RussianMarkingCode
$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());
}