Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.idea
.idea
vendor
composer.lock
build
.phpunit.result.cache
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# PHP Barcode
A PHP class for checking EAN8, EAN13, UPC and GTIN barcodes are valid (based on check digit).

[![Travis CI](https://travis-ci.org/milindsingh/validator.svg?branch=master)](https://travis-ci.org/milindsingh/validator)
[![Packagist](https://img.shields.io/packagist/v/milindsingh/validator.svg?maxAge=3600)](https://github.com/milindsingh/validator)
[![Packagist](https://img.shields.io/packagist/dt/milindsingh/validator.svg?maxAge=3600)](https://github.com/milindsingh/validator)
[![Packagist](https://img.shields.io/packagist/dm/milindsingh/validator.svg?maxAge=3600)](https://github.com/milindsingh/validator)
[![Packagist](https://img.shields.io/packagist/l/milindsingh/validator.svg?maxAge=3600)](https://github.com/milindsingh/validator)
[![PHP 7 ready](http://php7ready.timesplinter.ch/milindsingh/validator/master/badge.svg)](https://travis-ci.org/milindsingh/validator)


https://packagist.org/packages/milindsingh/validator

_Note: This project currently does nothing other than have some validation functions. I expect to add additional functionality in the future._
## Overview
A PHP class for checking EAN8, EAN13, UPC and GTIN barcodes are valid (based on check digit).

This project currently only offers validation functionality but additional functionality might be added in the future.

## Installation (with composer)
```
Expand All @@ -36,12 +36,12 @@ if ($validator->isValid()) {
// Get the barcode type
echo 'Barcode is in format of ' . $validator->getType();
// Possible formats returned are:
// (string) "GTIN" which equals constant \Ced\Validator\Barcode::TYPE_GTIN
// (string) "EAN-8" which equals constant \Ced\Validator\Barcode::TYPE_EAN_8
// (string) "EAN" which equals constant \Ced\Validator\Barcode::TYPE_EAN
// (string) "EAN Restricted" which equals constant \Ced\Validator\Barcode::TYPE_EAN_RESTRICTED
// (string) "UPC" which equals constant \Ced\Validator\Barcode::TYPE_UPC
// (string) "UPC Coupon Code" which equals constant \Ced\Validator\Barcode::TYPE_UPC_COUPON_CODE
// (string) "GTIN" which equals constant \Ced\Validator\BarcodeType::TYPE_GTIN
// (string) "EAN-8" which equals constant \Ced\Validator\BarcodeType::TYPE_EAN_8
// (string) "EAN" which equals constant \Ced\Validator\BarcodeType::TYPE_EAN
// (string) "EAN Restricted" which equals constant \Ced\Validator\BarcodeType::TYPE_EAN_RESTRICTED
// (string) "UPC" which equals constant \Ced\Validator\BarcodeType::TYPE_UPC
// (string) "UPC Coupon Code" which equals constant \Ced\Validator\BarcodeType::TYPE_UPC_COUPON_CODE


// Returns the barcode in GTIN-14 format
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"description": "A collection of PHP classes for managing barcodes.",
"license": "GPL-3.0+",
"require": {
"php": "^5.0 || ^7.0"
"php": "^7.4 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
"phpunit/phpunit": "^9.6"
},
"autoload": {
"psr-4": {
Expand Down
30 changes: 12 additions & 18 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
<phpunit
colors="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
stopOnError="true"
stopOnFailure="true"
stopOnWarning="true"
bootstrap="./vendor/autoload.php"
>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>

<!-- Add any additional test suites you want to run here -->
<testsuites>
Expand All @@ -18,22 +15,19 @@
</testsuite>
</testsuites>

<!-- Ignore vendor tests in code coverage reports -->
<filter>
<blacklist>
<coverage>
<exclude>
<directory suffix=".php">./vendor/</directory>
<directory suffix=".php">./tests/</directory>
</blacklist>
</filter>
</exclude>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<include>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</include>
</coverage>

<logging>
<log type="coverage-html" target="build/test" charset="UTF-8" highlight="false" lowUpperBound="80" highLowerBound="99"/>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
<testdoxHtml outputFile="build/test"/>
<text outputFile="php://stdout" />
</logging>
</phpunit>
</phpunit>
Loading