Skip to content

Commit e99af95

Browse files
authored
Merge pull request #1 from rocketfellows/CVFV-34
https://tracker.yandex.ru/CVFV-34
2 parents d0a1341 + 63923d3 commit e99af95

File tree

7 files changed

+2522
-40
lines changed

7 files changed

+2522
-40
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# <Country> vat number format validators config
1+
# Portugal vat number format validators config
22

33
![Code Coverage Badge](./badge.svg)
44

5-
This package provides a preconfigured configuration class for vat number format validators for <Country> country.
5+
This package provides a preconfigured configuration class for vat number format validators for Portugal country.
66
Is an extension of the package https://github.com/rocketfellows/specific-country-vat-number-format-validators-config.
77

88
## Installation
99

1010
```shell
11-
composer require rocketfellows/<country>-vat-number-format-validators-config
11+
composer require rocketfellows/pt-vat-number-format-validators-config
1212
```
1313

1414
## Dependencies
1515

1616
- https://github.com/rocketfellows/specific-country-vat-number-format-validators-config v1.0.0;
17-
- https://github.com/rocketfellows/<country>-vat-format-validator v1.0.0;
17+
- https://github.com/rocketfellows/pt-vat-format-validator v1.0.0;
1818

1919
## References
2020

@@ -23,31 +23,31 @@ composer require rocketfellows/<country>-vat-number-format-validators-config
2323

2424
## List of package components
2525

26-
- **_rocketfellows\<country>VatNumberFormatValidatorsConfig\<country>VatNumberFormatValidatorsConfig_** - preconfigured configuration class for vat number format validators for <Country> country;
26+
- **_rocketfellows\PTVatNumberFormatValidatorsConfig\PTVatNumberFormatValidatorsConfig_** - preconfigured configuration class for vat number format validators for Portugal country;
2727

28-
## <country>VatNumberFormatValidatorsConfig description
28+
## PTVatNumberFormatValidatorsConfig description
2929

30-
A configuration class that provides a match for the vat number format validators for the country <country>.
30+
A configuration class that provides a match for the vat number format validators for the country Portugal.
3131

3232
Class interface:
33-
- **_getCountry_** - returns <country> **_Country_** instance;
33+
- **_getCountry_** - returns Portugal **_Country_** instance;
3434
- **_getValidators_** - returns validators tuple
3535

36-
When initializing the default configuration, the **_getValidators_** function returns a tuple with a single validator - an instance of <country>VatFormatValidator.
36+
When initializing the default configuration, the **_getValidators_** function returns a tuple with a single validator - an instance of PTVatFormatValidator.
3737

3838
```php
39-
$config = new <country>VatNumberFormatValidatorsConfig();
39+
$config = new PTVatNumberFormatValidatorsConfig();
4040

41-
$config->getCountry(); // returns <country> Country instance
42-
$config->getValidators(); // returns CountryVatFormatValidators with one item - instance of <country>VatFormatValidator
41+
$config->getCountry(); // returns Portugal Country instance
42+
$config->getValidators(); // returns CountryVatFormatValidators with one item - instance of PTVatFormatValidator
4343
```
4444

4545
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.
4646
Attention - validator must implement interface **_CountryVatFormatValidatorInterface_**.
4747

4848
```php
4949
$newDefaultValidator = new NewDefaultValidator(); // instance of CountryVatFormatValidatorInterface
50-
$config = new <country>VatNumberFormatValidatorsConfig($newDefaultValidator); // initialize with new default validator
50+
$config = new PTVatNumberFormatValidatorsConfig($newDefaultValidator); // initialize with new default validator
5151

5252
$config->getValidators(); // returns CountryVatFormatValidators with one item - $newDefaultValidator
5353
```
@@ -61,7 +61,7 @@ And each additional validator must implement interface **_CountryVatFormatValida
6161
$firstAdditionalValidator = new FirstAdditionalValidator(); // instance of CountryVatFormatValidatorInterface
6262
$secondAdditionalValidator = new SecondAdditionalValidator(); // instance of CountryVatFormatValidatorInterface
6363

64-
$config = new <country>VatNumberFormatValidatorsConfig(
64+
$config = new PTVatNumberFormatValidatorsConfig(
6565
null,
6666
(
6767
new CountryVatFormatValidators(
@@ -72,7 +72,7 @@ $config = new <country>VatNumberFormatValidatorsConfig(
7272
);
7373

7474
// returns CountryVatFormatValidators with three items:
75-
// default preconfigured validator by default - instance of <country>VatFormatValidator
75+
// default preconfigured validator by default - instance of PTVatFormatValidator
7676
// $firstAdditionalValidator - from additional tuple
7777
// $secondAdditionalValidator - from additional tuple
7878
$config->getValidators();
@@ -85,7 +85,7 @@ $defaultValidator = new DefaultValidator(); // instance of Cou
8585
$firstAdditionalValidator = new FirstAdditionalValidator(); // instance of CountryVatFormatValidatorInterface
8686
$secondAdditionalValidator = new SecondAdditionalValidator(); // instance of CountryVatFormatValidatorInterface
8787

88-
$config = new <country>VatNumberFormatValidatorsConfig(
88+
$config = new PTVatNumberFormatValidatorsConfig(
8989
$defaultValidator,
9090
(
9191
new CountryVatFormatValidators(

badge.svg

Lines changed: 4 additions & 4 deletions
Loading

clover.xml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<coverage generated="1648587867">
3-
<project timestamp="1648587867">
4-
<metrics files="0" loc="0" ncloc="0" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
2+
<coverage generated="1682802200">
3+
<project timestamp="1682802200">
4+
<file name="/app/src/PTVatNumberFormatValidatorsConfig.php">
5+
<class name="rocketfellows\PTVatNumberFormatValidatorsConfig\PTVatNumberFormatValidatorsConfig" namespace="global">
6+
<metrics complexity="2" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="2" elements="4" coveredelements="4"/>
7+
</class>
8+
<line num="13" type="method" name="getCountry" visibility="public" complexity="1" crap="1" count="8"/>
9+
<line num="15" type="stmt" count="8"/>
10+
<line num="18" type="method" name="getDefaultValidator" visibility="protected" complexity="1" crap="1" count="4"/>
11+
<line num="20" type="stmt" count="4"/>
12+
<metrics loc="23" ncloc="23" classes="1" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="2" elements="4" coveredelements="4"/>
13+
</file>
14+
<metrics files="1" loc="23" ncloc="23" classes="1" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="2" elements="4" coveredelements="4"/>
515
</project>
616
</coverage>

composer.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
// TODO: set name
3-
"name": "rocketfellows/<country>-vat-number-format-validators-config",
2+
"name": "rocketfellows/pt-vat-number-format-validators-config",
43
"authors": [
54
{
65
"name": "Arslan Imamutdinov",
@@ -11,8 +10,7 @@
1110
"require": {
1211
"php": ">=7.4",
1312
"rocketfellows/specific-country-vat-number-format-validators-config": "1.0.0",
14-
// TODO: require vat format validator package
15-
"rocketfellows/<country>-vat-format-validator": "1.0.0"
13+
"rocketfellows/pt-vat-format-validator": "1.0.0"
1614
},
1715
"require-dev": {
1816
"phpunit/phpunit": "^8.5",
@@ -22,14 +20,12 @@
2220
},
2321
"autoload": {
2422
"psr-4": {
25-
// TODO: set namespace
26-
"rocketfellows\\<country>VatNumberFormatValidatorsConfig\\": "src/"
23+
"rocketfellows\\PTVatNumberFormatValidatorsConfig\\": "src/"
2724
}
2825
},
2926
"autoload-dev": {
3027
"psr-4": {
31-
// TODO: set namespace
32-
"rocketfellows\\<country>VatNumberFormatValidatorsConfig\\tests\\": "tests/"
28+
"rocketfellows\\PTVatNumberFormatValidatorsConfig\\tests\\": "tests/"
3329
}
3430
}
3531
}

0 commit comments

Comments
 (0)