Skip to content

Commit 8cab563

Browse files
committed
Update IbanTrait.php
1 parent f1582af commit 8cab563

File tree

1 file changed

+9
-27
lines changed

1 file changed

+9
-27
lines changed

src/Traits/IbanTrait.php

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ trait IbanTrait
66
{
77
/**
88
* Set value of $countries property.
9-
*
10-
* @return void
119
*/
12-
private function setCountries(?array $countries)
10+
private function setCountries(?array $countries): void
1311
{
1412
if (empty($countries)) {
1513
$this->countries = [];
@@ -28,10 +26,8 @@ private function setCountries(?array $countries)
2826

2927
/**
3028
* Check IBAN is valid.
31-
*
32-
* @return bool
3329
*/
34-
private function isIbanValid(string $iban)
30+
private function isIbanValid(string $iban): bool
3531
{
3632
if (! $this->checkIbanFormat($iban)) {
3733
return false;
@@ -52,10 +48,8 @@ private function isIbanValid(string $iban)
5248

5349
/**
5450
* Check IBAN format is valid.
55-
*
56-
* @return bool
5751
*/
58-
private function checkIbanFormat(string $iban)
52+
private function checkIbanFormat(string $iban): bool
5953
{
6054
if (empty($iban)) {
6155
return false;
@@ -71,40 +65,32 @@ private function checkIbanFormat(string $iban)
7165

7266
/**
7367
* Get IBAN country code.
74-
*
75-
* @return string
7668
*/
77-
private function getIbanCountryCode(string $iban)
69+
private function getIbanCountryCode(string $iban): string
7870
{
7971
return substr($iban, 0, 2);
8072
}
8173

8274
/**
8375
* Check if bcmod function is available.
84-
*
85-
* @return bool
8676
*/
87-
private function checkIfBcmodIsAvailable()
77+
private function checkIfBcmodIsAvailable(): bool
8878
{
8979
return function_exists('bcmod');
9080
}
9181

9282
/**
9383
* Check two first character's validity.
94-
*
95-
* @return bool
9684
*/
97-
private function twoFirstCharactersValid(string $countryCode)
85+
private function twoFirstCharactersValid(string $countryCode): bool
9886
{
9987
return ! empty($countryCode) && ctype_alpha($countryCode);
10088
}
10189

10290
/**
10391
* Check countries of the IBAN.
104-
*
105-
* @return bool
10692
*/
107-
private function isCountriesValid(string $ibanCountryCode)
93+
private function isCountriesValid(string $ibanCountryCode): bool
10894
{
10995
if (empty($this->countries)) {
11096
return true;
@@ -121,10 +107,8 @@ private function isCountriesValid(string $ibanCountryCode)
121107

122108
/**
123109
* Check country of the IBAN.
124-
*
125-
* @return bool
126110
*/
127-
private function isCountryValid(string $country, string $ibanCountryCode)
111+
private function isCountryValid(string $country, string $ibanCountryCode): bool
128112
{
129113
return ! empty($country)
130114
&& isset($this->ibanLengthByCountry[$country])
@@ -133,10 +117,8 @@ private function isCountryValid(string $country, string $ibanCountryCode)
133117

134118
/**
135119
* Check country of the IBAN.
136-
*
137-
* @return bool
138120
*/
139-
private function isIbanLengthValid(string $iban, string $ibanCountryCode)
121+
private function isIbanLengthValid(string $iban, string $ibanCountryCode): bool
140122
{
141123
return strlen($iban) === $this->ibanLengthByCountry[$ibanCountryCode];
142124
}

0 commit comments

Comments
 (0)