<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rocketfellows / at-vat-number-format-validators-config example snippets
$config = new ATVatNumberFormatValidatorsConfig();
$config->getCountry(); // returns Austria Country instance
$config->getValidators(); // returns CountryVatFormatValidators with one item - instance of ATVatFormatValidator
$newDefaultValidator = new NewDefaultValidator(); // instance of CountryVatFormatValidatorInterface
$config = new ATVatNumberFormatValidatorsConfig($newDefaultValidator); // initialize with new default validator
$config->getValidators(); // returns CountryVatFormatValidators with one item - $newDefaultValidator
$firstAdditionalValidator = new FirstAdditionalValidator(); // instance of CountryVatFormatValidatorInterface
$secondAdditionalValidator = new SecondAdditionalValidator(); // instance of CountryVatFormatValidatorInterface
$config = new ATVatNumberFormatValidatorsConfig(
null,
(
new CountryVatFormatValidators(
$firstAdditionalValidator,
$secondAdditionalValidator
)
)
);
// returns CountryVatFormatValidators with three items:
// default preconfigured validator by default - instance of ATVatFormatValidator
// $firstAdditionalValidator - from additional tuple
// $secondAdditionalValidator - from additional tuple
$config->getValidators();
$defaultValidator = new DefaultValidator(); // instance of CountryVatFormatValidatorInterface
$firstAdditionalValidator = new FirstAdditionalValidator(); // instance of CountryVatFormatValidatorInterface
$secondAdditionalValidator = new SecondAdditionalValidator(); // instance of CountryVatFormatValidatorInterface
$config = new ATVatNumberFormatValidatorsConfig(
$defaultValidator,
(
new CountryVatFormatValidators(
$firstAdditionalValidator,
$secondAdditionalValidator
)
)
);
// returns CountryVatFormatValidators with three items:
// $defaultValidator from constructor first parameter
// $firstAdditionalValidator - from additional tuple
// $secondAdditionalValidator - from additional tuple
$config->getValidators();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.