{"id":13608116,"url":"https://github.com/ronanguilloux/IsoCodes","last_synced_at":"2025-04-12T14:32:01.274Z","repository":{"id":5005807,"uuid":"6164123","full_name":"ronanguilloux/IsoCodes","owner":"ronanguilloux","description":"PHP library - Validators for standards from ISO, International Finance, Public Administrations, GS1, Manufacturing Industry, Phone numbers \u0026 Zipcodes for many countries","archived":false,"fork":false,"pushed_at":"2024-05-04T21:16:46.000Z","size":592,"stargazers_count":788,"open_issues_count":24,"forks_count":76,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-05-17T01:42:26.455Z","etag":null,"topics":["administrations","gs1","gtin","international-finance","isocodes","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ronanguilloux.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-10-10T20:43:47.000Z","updated_at":"2024-06-18T11:06:56.146Z","dependencies_parsed_at":"2024-06-18T11:18:01.653Z","dependency_job_id":null,"html_url":"https://github.com/ronanguilloux/IsoCodes","commit_stats":{"total_commits":400,"total_committers":40,"mean_commits":10.0,"dds":"0.25249999999999995","last_synced_commit":"d939c3fc8f93f1f748f95025a307dc5dba8dccbe"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanguilloux%2FIsoCodes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanguilloux%2FIsoCodes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanguilloux%2FIsoCodes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanguilloux%2FIsoCodes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ronanguilloux","download_url":"https://codeload.github.com/ronanguilloux/IsoCodes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248581261,"owners_count":21128137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["administrations","gs1","gtin","international-finance","isocodes","php"],"created_at":"2024-08-01T19:01:24.415Z","updated_at":"2025-04-12T14:32:00.925Z","avatar_url":"https://github.com/ronanguilloux.png","language":"PHP","funding_links":[],"categories":["过滤和验证","目录","Table of Contents","PHP","过滤和验证 Filtering and Validation","过滤和验证( Filtering ang Validation )","Filtering and Validation"],"sub_categories":["过滤和验证 Filtering and Validation","Filtering and Validation","Filtering, Sanitizing and Validation","Globalization"],"readme":"# IsoCodes\n\nPHP library - Validators for standards from ISO, International Finance, Public Administrations, GS1, Book Industry, Phone numbers \u0026 Zipcodes for many countries\n\n## Usage\n\n```php\n// Sending letters to the Labrador Islands ?\n$isCanadian = ZipCode::validate('A0A 1A0', 'CA');\n\n// Checking out your e-commerce shopping cart?\n$isBankable = CreditCard::validate('12345679123456');\n\n// Transferring money worldwide?\n$isSwiftBic = SwiftBic::validate('CEDELULLXXX');\n\n// Paying your taxes in Madrid?\n$isTaxableInSpain = Nif::validate('A999999L');\n\n// Receiving containers from Port of Shanghai?\n$isShippingContainerCode = Sscc::validate('806141411234567896');\n\n// Publishing books?\n$isPublished = Isbn::validate('2-2110-4199-X')\n\n// Trading items with GTIN barcodes in GS1 system?\n$isBarcode = Ean13::validate('4719512002889')\n\n// Calling phone numbers in Palo Alto?\n$isPhonable = PhoneNumber::validate('+1-650-798-2800', 'US')\n\n// Buying Apple stocks?\n$isISIN = Isin::validate('US0378331005'); // Apple Inc. (AAPL)\n\n// Trading Apple products?\n$isCUSIP = Cusip::validate('037833100'); // Apple Inc. (AAPL)\n\n// Checking your iPhone device is valid?\n$isDevice = Imei::validate('352066060926230');\n\n// Selling your Honda Civic?\n$isVin = VinNA::validate('1HGBH41JXMN109186');    \n```\n\n\n## ISO Codes Validations available:\n\n### International Finance\n\n* IBAN (requires `bcmath` PHP extension)\n* SWIFT/BIC\n* BBAN (RIB, requires `bcmath` PHP extension)\n* Credit Card number\n* SEDOL (Stock Exchange codes)\n\n### Manufacturing Industries\n\n* ISBN - International Standard Book Number, both 10 \u0026 13 digits\n* ISMN - International Standard Music Number\n* ISWC - International Standard Musical Work Code\n* IMEI - International Mobile Equipment Identity\n* VIN  - Vehicle Identification Number – ISO 3779 \u0026 ISO 4030\n\n### Public Administrations\n\n* ISIN - International Securities Identification Number\n* Country-specific VAT / tax system: various VAT number formats\n* France: Numéro de Sécurité Sociale / INSEE, SIREN, SIRET, Codes postaux, Clef Type 1/2 Norme B2\n* US: Social Security number\n* UK: National Insurance Number (NINO)\n* Belgium: Structured Ccommunication (\"communication structurée\")\n* Spain: NIF, NIE (Número de Identificación Fiscal/Extranjero) \u0026 CIF (Código de identificación fiscal)\n* Netherlands: Burgerservicenummer / Citizen Service Number (BSN)\n* Finland: HETU, Henkilötunnus (Finnish personal identity code)\n* Switzerland: Business Orgs UID (VAT) Number / Unternehmens-Identifikationsnummer\n\n### GS1 specific numbers/identifiers\n\n* GTIN - Global Trade Item Number: GTIN-8, GTIN-12, GTIN-13, GTIN-14\n* GLN - Global Location Number\n* SSCC - Serial Shipping Container Code\n* GRAI - Global Returnable Asset Identifier\n* GSRN - Global Service Relation Number\n* GDTI - Global Document Type Identifier\n* UDI - Unique Device Identification (the GTIN part of it)\n* Older/deprecated identifiers, now in GTIN: EAN-8, EAN-13, UCC-13, UPC-A, DUN-14, ITF-14\n\n### Miscellaneous\n\n* ZIP code validators for 175+ countries\n* Phone number validation for all countries/regions of the world\n\nEach code has its own validator.\nEach validator is illustrated by a unit test case.\n\nIsoCodes is compatible with all versions of PHP that are [actively supported](http://php.net/supported-versions.php) by the PHP project.\n\n\n## Build status\n\n\n[![License](https://poser.pugx.org/ronanguilloux/isocodes/license.svg)](https://packagist.org/packages/ronanguilloux/isocodes)\n[![Latest Stable Version](https://poser.pugx.org/ronanguilloux/isocodes/v/stable.svg)](https://packagist.org/packages/ronanguilloux/isocodes)\n[![Build Status](https://app.travis-ci.com/ronanguilloux/IsoCodes.svg?branch=master)](https://app.travis-ci.com/ronanguilloux/IsoCodes)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ronanguilloux/IsoCodes/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ronanguilloux/IsoCodes/?branch=master)\n[![SymfonyInsight](https://insight.symfony.com/projects/fde42adb-344d-4055-b78d-20b598040ac8/mini.svg)](https://insight.symfony.com/projects/fde42adb-344d-4055-b78d-20b598040ac8)\n[![Coverage Status](https://coveralls.io/repos/ronanguilloux/IsoCodes/badge.svg?branch=master)](https://coveralls.io/r/ronanguilloux/IsoCodes?branch=master)\n[![Total Downloads](https://poser.pugx.org/ronanguilloux/isocodes/downloads)](https://packagist.org/packages/ronanguilloux/isocodes)\n[![Monthly Downloads](https://poser.pugx.org/ronanguilloux/isocodes/d/monthly.png)](https://packagist.org/packages/ronanguilloux/isocodes)\n[![Daily Downloads](https://poser.pugx.org/ronanguilloux/isocodes/d/daily.png)](https://packagist.org/packages/ronanguilloux/isocodes)\n\n\nContinously inspecting results (phpdoc, phpmd, phpcc, etc.) available on [Scrutinizer CI](https://scrutinizer-ci.com/g/ronanguilloux/IsoCodes/inspections)\n\n\n## bcmath as an optional extension for certain validators\n\nFor IBAN \u0026 BBAN ISO-codes, PHP is required to be compiled with \"--enable-bcmath\" for arbitrary precision mathematic checks.\nUsually, you already have `bcmath` bundled in your PHP version, since many common PHP packages (`php-cli`, `php-fpm`, `php5-cgi`, `libapache2-mod-php5`, etc.) in stable GNU/Linux distribution releases (such as Debian) are listed as having `bcmath` built in to them, as an included module.\n\n\n## Installing\n\n### Via GitHub\n\n```bash\n$ git clone git@github.com:ronanguilloux/IsoCodes.git\n```\n\nAutoloading is PSR-0 friendly.\n\n### Via [Packagist](https://packagist.org/packages/ronanguilloux/isocodes) \u0026 [Composer](https://getcomposer.org/doc/00-intro.md)\n\nRequire the latest version of `ronanguilloux/isocodes` with Composer\n\n```bash\n$ composer require ronanguilloux/isocodes\n```\n\n## Wrappers\n\n### With Symfony Validator\n\nInstall [Soullivaneuh/IsoCodesValidator](https://github.com/Soullivaneuh/IsoCodesValidator)\nto get IsoCodes working as Validator for **Symfony** and **Silex**.\n\n### With CakePHP 3\n\nInstall [gourmet/validation](https://github.com/gourmet/validation)\nto get IsoCodes working with **CakePHP 3** as a validator.\n\n### With Laravel\n\nInstall [pixelpeter/laravel5-isocodes-validation](https://github.com/pixelpeter/laravel5-isocodes-validation)\nto get IsoCodes working with **Laravel 5** as a validator.\n\n## Supported PHP versions\n\n- 7.3\n- 7.4\n\n## Unit testing\n\n```bash\n$ phpunit --testdox --coverage-text\n```\n\n\n## Make utilities\n\nFor development \u0026 contribution purpose only,\na Makefile provides various tools to check your code style, quality \u0026 test coverage:\n\n```\nUsual tasks:\n\n\tTo initialize vendors:  make\n\tTo check code quality:\tmake quality\n\tTo run tests suite:\t    make tests\n\tTo fix code style:\t    make cs-fix\n\nOther specific tasks:\n\n\tTo evaluate code coverage:\t\t\t        make codecoverage\n\tTo run a simple continuous tests server:\tmake continuous\n\tTo dry-fix code style issues:\t\t\t    make dry-fix\n\tTo evaluate code quality stats:\t\t\t    make stats\n\tTo update vendors using Composer:\t\t    make update\n```\n\n\n## Quality assurance report\n\nIsocodes quality plan is mainly based on phpunit: it runs 980+ unit tests,\nwith separated valid \u0026 invalid entry sets.\nTest values are mainly real data or documented examples from standard documentation, and a few handmade values.\n\nThe `composer.json` already includes these  [Php Quality Assurance Toolchain](https://phpqa.io) libraries:\n\n* [phploc](https://github.com/sebastianbergmann/phploc)\n* [phpmd](https://github.com/phpmd/phpmd)\n* [phpcpd](https://github.com/sebastianbergmann/phpcpd)\n* [pdepend](https://github.com/pdepend/pdepend)\n* [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)\n\nJust run:\n\n```bash\n$ make stats -i\n```\n\nXML report outputs are then generated in a new `./build` folder\n\nCode covering report built using [Coveralls.io](https://coveralls.io/r/ronanguilloux/IsoCodes).\n[How-to generate such code coverage report using PHPUnit](https://github.com/satooshi/php-coveralls/blob/master/README.md).\n\n\n## License Information\n\n* GNU GPL v3\n* You can find a copy of this software here: https://github.com/ronanguilloux/IsoCodes\n\n\n## Contributing Code\n\nThe issue queue can be found at: https://github.com/ronanguilloux/IsoCodes/issues.\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n\n## Special thanks\n\n[Contributors list](https://github.com/ronanguilloux/IsoCodes/graphs/contributors): Many thanks to all!\n\nMany thanks to [JetBrains PhpStorm](http://www.jetbrains.com/phpstorm/) for having sponsored the IsoCode library development from the very beginning! Any contributor having an accepted PR may receive an Open Source License Key for [PhpStorm IDE](http://www.jetbrains.com/phpstorm/download/). Just ping [Ronan via email](mailto:ronan.guilloux@gmail.com) to get one.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronanguilloux%2FIsoCodes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fronanguilloux%2FIsoCodes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronanguilloux%2FIsoCodes/lists"}