Download the PHP package daycry/iban without Composer

On this page you can find all versions of the php package daycry/iban. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package iban

Tests Coverage Status

PHPStan Code Style CodeQL

Latest Stable Version Total Downloads License PHP Version Require

Stars Forks Issues

Daycry Iban

IBAN validation, parsing, formatting and bank-entity resolution for CodeIgniter 4 — usable standalone, with a zero-dependency core.

Quickstart

Facade (framework-free, works standalone)

CI4 service

CI4 helper

spark commands

Complete per-symbol API reference: docs/api-reference.md. Task-oriented guide — the 16 ViolationCode cases, the national validators, caching, and the Config\Iban options: see docs/importers.md.

API overview

The public surface is the facade Daycry\Iban\Iban (also what service('iban') returns). Every method accepts a raw string; the ones that already have a parsed value object accept that too.

IBAN

Method What it does
normalize(string $iban): string Uppercases and strips spaces/separators to the canonical electronic form. Pure string operation — no validation.
validate(string\|ParsedIban $iban, bool $checkNational = false): ValidationResult Full validation: country is in the registry, correct length, BBAN token grammar, and MOD-97 check digits — plus, with checkNational: true, the country's national check digit (ES/BE/PT/SI/FI/FR/IT…). Never throws; returns a ValidationResult exposing isValid() and the list of Violations.
isValid(string\|ParsedIban $iban): bool Boolean shortcut over validate().
parse(string $iban): ParsedIban Validates, then decomposes into a ParsedIban (country code, check digits, BBAN, bank identifier, branch identifier, account number, national check digit). Throws InvalidIbanException (which carries the failing ValidationResult) when the IBAN is invalid.
tryParse(string $iban): ?ParsedIban Same as parse() but returns null instead of throwing.
format(string\|ParsedIban $iban, IbanFormat $f = IbanFormat::Print): string Renders Electronic (no spaces), Print (groups of 4), or Anonymized (country code + last 4 digits, the rest masked).
resolve(string\|ParsedIban $iban): BankResult Looks up the owning bank through the configured provider. Always returns a BankResult (the ParsedIban plus nullable bank fields); isResolved() is false with the default NullProvider, or filled in by DatabaseProvider / the iban.com fallback. resolvedBy tells you which provider answered.

BIC / SWIFT

Method What it does
normalizeBic(string $bic): string Uppercases and strips whitespace.
validateBic(string\|ParsedBic $bic): ValidationResult Structural ISO 9362 validation: length 8 or 11, character classes per position, and country code (positions 5-6) present in the bundled ISO 3166-1 registry. Never throws. A BIC has no checksum, so "valid" means well-formed with a recognised country, never "this BIC exists".
isValidBic(string\|ParsedBic $bic): bool Boolean shortcut over validateBic().
parseBic(string $bic): ParsedBic Validates, then slices into a ParsedBic (institution, country, location, optional branch code). Throws InvalidBicException when invalid.
tryParseBic(string $bic): ?ParsedBic Same as parseBic() but returns null.
validateIbanAndBic(?string $iban, ?string $bic): ValidationResult The "one, the other, or both" entry point: validates whichever value is provided, and when both are valid also cross-checks them — country always, and bank for the 19 countries whose IBAN bank code is the BIC's 4-letter prefix.
resolveBic(string\|ParsedBic $bic): ?BankInfo Resolves a bank straight from a BIC (BIC8 match against the provider's banks data). Returns null (never throws) on a malformed BIC or an unresolved lookup.

Sub-service accessors

validator(), parser(), resolver(), bicValidator() and bicParser() return the underlying components, for when you want to reuse a single instance or call them directly.

The helper (helper('iban')) mirrors these as plain functions (iban_validate(), iban_parse(), iban_resolve(), bic_is_valid(), iban_bic_validate(), …) and every helper is degradation-safe — none throw. See docs/api-reference.md for the exhaustive per-symbol reference.

Database setup (optional)

Validation, parsing, formatting and BIC checks need no database — the core ships a compiled registry and works out of the box. The database is only for bank-entity resolution (resolve() / resolveBic() returning real bank names and BICs) and, optionally, for serving the ISO 3166-1 country list from a table instead of the bundled compiled list. These steps only apply under CodeIgniter 4.

1. Run the migrations

Both tables (banks and iso_countries) live in the package's module namespace, so migrate it:

2. Enable the database provider

Publish the config (php spark iban:publish) and, in app/Config/Iban.php, switch the provider:

3. Populate the banks table

No bank data ships with the package (by licensing design — see docs/licensing.md). You fill the table yourself from official sources with the bundled importers:

The BanksSeeder is intentionally empty — it exists only as a seed hook; the importers are the real data path. See docs/importers.md for the full source list and coverage matrix.

4. (Optional) Serve ISO 3166-1 from the database

BIC validation uses the bundled compiled ISO 3166-1 list by default ($isoCountrySource = 'php' — nothing to install). To serve it from the iso_countries table instead (so you can edit it in the DB), set $isoCountrySource = 'database' in app/Config/Iban.php and seed the table from the compiled list:

Features

Standalone usage (outside CodeIgniter 4)

The core has zero framework dependencies (PHP ^8.3 + ext-mbstring + ext-iconv + ext-zip only), so you can use it without CI4 installed at all:

codeigniter4/framework is only a require-dev (test/dev) dependency — it is never pulled in by a plain composer require daycry/iban for standalone use. Config\Iban, Config\Services, the spark commands, Models\BankModel, the optional DatabaseProvider/CachedProvider, and Import\ImportRunner are the only pieces that need CI4; they simply aren't loaded unless CI4 itself is present in the consuming application. The bundled importers themselves (Import\Importers/*) and the ImporterInterface/ImportReport/ImporterRegistry framework stay CI4-free, fetching over plain PHP.

Architecture

The package is split into two layers connected by a one-way dependency rule: the framework-free core and resolver never know about CodeIgniter 4.

See CLAUDE.md for the full breakdown, including which directories are guarded (framework-free) and which are allowed to depend on CI4.

Compatibility matrix

PHP CodeIgniter 4 Status
8.3 ^4.6 ✅ CI-tested
8.4 ^4.6 ✅ CI-tested

CodeIgniter 4 is optional (require-dev only) — the core works on plain PHP 8.3/8.4 with no framework at all.

Documentation

Development

No composer.lock: as a library (not an application), composer.lock is gitignored on purpose. CI always runs composer update against the version constraints in composer.json, so the test matrix reflects what consumers actually get.

License

MIT License - see LICENSE file for details.


All versions of iban with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-dom Version *
ext-iconv Version *
ext-mbstring Version *
ext-zip Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package daycry/iban contains the following files

Loading the files please wait ...