diff --git a/README.md b/README.md index 081babc..e10addb 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# vat number format validators config +# Croatia vat number format validators config ![Code Coverage Badge](./badge.svg) -This package provides a preconfigured configuration class for vat number format validators for country. +This package provides a preconfigured configuration class for vat number format validators for Croatia country. Is an extension of the package https://github.com/rocketfellows/specific-country-vat-number-format-validators-config. ## Installation ```shell -composer require rocketfellows/-vat-number-format-validators-config +composer require rocketfellows/hr-vat-number-format-validators-config ``` ## Dependencies - https://github.com/rocketfellows/specific-country-vat-number-format-validators-config v1.0.0; -- https://github.com/rocketfellows/-vat-format-validator v1.0.0; +- https://github.com/rocketfellows/hr-vat-format-validator v1.0.0; ## References @@ -23,23 +23,23 @@ composer require rocketfellows/-vat-number-format-validators-config ## List of package components -- **_rocketfellows\VatNumberFormatValidatorsConfig\VatNumberFormatValidatorsConfig_** - preconfigured configuration class for vat number format validators for country; +- **_rocketfellows\HRVatNumberFormatValidatorsConfig\HRVatNumberFormatValidatorsConfig_** - preconfigured configuration class for vat number format validators for Croatia country; -## VatNumberFormatValidatorsConfig description +## HRVatNumberFormatValidatorsConfig description -A configuration class that provides a match for the vat number format validators for the country . +A configuration class that provides a match for the vat number format validators for the country Croatia. Class interface: -- **_getCountry_** - returns **_Country_** instance; +- **_getCountry_** - returns Croatia **_Country_** instance; - **_getValidators_** - returns validators tuple -When initializing the default configuration, the **_getValidators_** function returns a tuple with a single validator - an instance of VatFormatValidator. +When initializing the default configuration, the **_getValidators_** function returns a tuple with a single validator - an instance of HRVatFormatValidator. ```php -$config = new VatNumberFormatValidatorsConfig(); +$config = new HRVatNumberFormatValidatorsConfig(); -$config->getCountry(); // returns Country instance -$config->getValidators(); // returns CountryVatFormatValidators with one item - instance of VatFormatValidator +$config->getCountry(); // returns Croatia Country instance +$config->getValidators(); // returns CountryVatFormatValidators with one item - instance of HRVatFormatValidator ``` You can override the default validator by initializing the configuration class object with a new default validator through the first parameter of the class constructor. @@ -47,7 +47,7 @@ Attention - validator must implement interface **_CountryVatFormatValidatorInter ```php $newDefaultValidator = new NewDefaultValidator(); // instance of CountryVatFormatValidatorInterface -$config = new VatNumberFormatValidatorsConfig($newDefaultValidator); // initialize with new default validator +$config = new HRVatNumberFormatValidatorsConfig($newDefaultValidator); // initialize with new default validator $config->getValidators(); // returns CountryVatFormatValidators with one item - $newDefaultValidator ``` @@ -61,7 +61,7 @@ And each additional validator must implement interface **_CountryVatFormatValida $firstAdditionalValidator = new FirstAdditionalValidator(); // instance of CountryVatFormatValidatorInterface $secondAdditionalValidator = new SecondAdditionalValidator(); // instance of CountryVatFormatValidatorInterface -$config = new VatNumberFormatValidatorsConfig( +$config = new HRVatNumberFormatValidatorsConfig( null, ( new CountryVatFormatValidators( @@ -72,7 +72,7 @@ $config = new VatNumberFormatValidatorsConfig( ); // returns CountryVatFormatValidators with three items: -// default preconfigured validator by default - instance of VatFormatValidator +// default preconfigured validator by default - instance of HRVatFormatValidator // $firstAdditionalValidator - from additional tuple // $secondAdditionalValidator - from additional tuple $config->getValidators(); @@ -85,7 +85,7 @@ $defaultValidator = new DefaultValidator(); // instance of Cou $firstAdditionalValidator = new FirstAdditionalValidator(); // instance of CountryVatFormatValidatorInterface $secondAdditionalValidator = new SecondAdditionalValidator(); // instance of CountryVatFormatValidatorInterface -$config = new VatNumberFormatValidatorsConfig( +$config = new HRVatNumberFormatValidatorsConfig( $defaultValidator, ( new CountryVatFormatValidators(