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
Requires
- php: ^7.1
- lamoda/gs1-barcode-parser: ^0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- phpunit/phpunit: ^7.5 | ^8.2
This package is auto-updated.
Last update: 2023-05-26 16:19:52 UTC
README
Installation
Composer
composer require lamoda/gs1-barcode-validator-rules
Description
This library is a collection of rules for GS1 barcode parser library.
Rules
- 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()); }