Download the PHP package rocketfellows/specific-country-vat-number-format-validators-config without Composer

On this page you can find all versions of the php package rocketfellows/specific-country-vat-number-format-validators-config. 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 specific-country-vat-number-format-validators-config

Specific country vat number format validator config

This package provides an abstract class for configuring a list of validators for a specific country. It is one of the implementations of the CountryVatNumberFormatValidatorsConfigInterface interface.

Installation

Dependencies

List of package components

SpecificCountryVatNumberFormatValidatorsConfig description

SpecificCountryVatNumberFormatValidatorsConfig properties:

SpecificCountryVatNumberFormatValidatorsConfig functions:

Class constructor takes two optional parameters:

A child class extending SpecificCountryVatNumberFormatValidatorsConfig must implement the following functions:

Depending on the parameters passed to the constructor of the child class, the $validators tuple is formed in the CountryVatFormatValidators tuple, the validators in which are typed according to the following rules:

Usage example

Let's say we need to implement the configuration of vat number format validators for Germany. To do this, you need to create a class (for example, DEVatNumberFormatValidatorsConfig) and inherit it from SpecificCountryVatNumberFormatValidatorsConfig. The default vat number format validator for Germany can be used from the package https://packagist.org/packages/rocketfellows/de-vat-format-validator - there is already a validator class for Germany that implements the CountryVatFormatValidatorInterface interface. For default vat number format validator for Germany we will use DEVatFormatValidator. For getCountry function we can use arslanimamutdinov\ISOStandard3166\ISO3166 utility we already defined Country getter for Germany.

And that's it, we created default pre-configured vat number format validators for Germany.

Let's say we want to replace the implementation of the vat number format validator for Germany in the current config. To do this, you need to create a new validator class that must implement the CountryVatFormatValidatorInterface interface.

Further, when instantiating DEVatNumberFormatValidatorsConfig to the constructor, as the first parameter, you need to pass the instance of the new validator, which will replace the default validator from the config.

Suppose we do not want to replace the default validator in the config, but want to add AnotherDEVatFormatValidator as an additional one. For example, the default validator checks the vat number format only for individuals, and we want the config to have a validator that checks the vat number format for legal entities. To do this, when instantiating DEVatNumberFormatValidatorsConfig, pass null as the first parameter, and pass the CountryVatFormatValidators tuple consisting of one element as the second parameter.

If you want to completely change the DEVatNumberFormatValidatorsConfig configuration, then you need to pass your own as the default validator and as additional validators when instantiating the config.

More use case examples can be found in the package's unit tests: rocketfellows\SpecificCountryVatNumberFormatValidatorsConfig\tests\unit\SpecificCountryVatNumberFormatValidatorsConfigTest.

Contributing

Welcome to pull requests. If there is a major changes, first please open an issue for discussion.

Please make sure to update tests as appropriate.


All versions of specific-country-vat-number-format-validators-config with dependencies

PHP Build Version
Package 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 rocketfellows/specific-country-vat-number-format-validators-config contains the following files

Loading the files please wait ....