Skip to content

Commit 16a9aa3

Browse files
committed
Apply coding standard
1 parent de72b6a commit 16a9aa3

371 files changed

Lines changed: 1750 additions & 1389 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/CountryPostcodeFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ interface CountryPostcodeFormatter
2020
*
2121
* @return string|null The formatted postcode, or NULL if the postcode is invalid.
2222
*/
23-
public function format(string $postcode) : ?string;
23+
public function format(string $postcode): ?string;
2424
}

src/FormatHelper/StripPrefix.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
namespace Brick\Postcode\FormatHelper;
66

7+
use function strlen;
8+
use function substr;
9+
710
/**
811
* Strip country code prefix from postalcode if it is valid.
912
*
@@ -12,17 +15,12 @@
1215
* Rather than failing this format into an exception, this helper class strips the prefix off before validating it,
1316
* Thus providing you with the correct format without the country code prefix in it.
1417
*
15-
* @see https://en.wikipedia.org/wiki/Postal_codes_in_Belgium
16-
*
1718
* @internal
19+
*
20+
* @see https://en.wikipedia.org/wiki/Postal_codes_in_Belgium
1821
*/
1922
trait StripPrefix
2023
{
21-
/**
22-
* @param string $postcode
23-
* @param string $prefix
24-
* @return string
25-
*/
2624
public function stripPrefix(string $postcode, string $prefix): string
2725
{
2826
$prefixLength = strlen($prefix);

src/Formatter/ADFormatter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
use Brick\Postcode\CountryPostcodeFormatter;
88

9+
use function preg_match;
10+
use function str_starts_with;
11+
use function substr;
12+
913
/**
1014
* Validates and formats postcodes in Andorra.
1115
*
@@ -17,7 +21,7 @@
1721
*/
1822
final class ADFormatter implements CountryPostcodeFormatter
1923
{
20-
public function format(string $postcode) : ?string
24+
public function format(string $postcode): ?string
2125
{
2226
if (str_starts_with($postcode, 'AD')) {
2327
$postcode = substr($postcode, 2);

src/Formatter/AFFormatter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use Brick\Postcode\CountryPostcodeFormatter;
88

9+
use function preg_match;
10+
use function substr;
11+
912
/**
1013
* Validates and formats postcodes in Afghanistan.
1114
*
@@ -20,7 +23,7 @@
2023
*/
2124
final class AFFormatter implements CountryPostcodeFormatter
2225
{
23-
public function format(string $postcode) : ?string
26+
public function format(string $postcode): ?string
2427
{
2528
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
2629
return null;

src/Formatter/AIFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
final class AIFormatter implements CountryPostcodeFormatter
1818
{
19-
public function format(string $postcode) : ?string
19+
public function format(string $postcode): ?string
2020
{
2121
if ($postcode === '2640' || $postcode === 'AI2640') {
2222
return 'AI-2640';

src/Formatter/ALFormatter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
use Brick\Postcode\CountryPostcodeFormatter;
88

9+
use function preg_match;
10+
911
/**
1012
* Validates and formats postcodes in Albania.
1113
*
@@ -16,7 +18,7 @@
1618
*/
1719
final class ALFormatter implements CountryPostcodeFormatter
1820
{
19-
public function format(string $postcode) : ?string
21+
public function format(string $postcode): ?string
2022
{
2123
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
2224
return null;

src/Formatter/AMFormatter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
use Brick\Postcode\CountryPostcodeFormatter;
88

9+
use function preg_match;
10+
911
/**
1012
* Validates and formats postcodes in Armenia.
1113
*
@@ -16,7 +18,7 @@
1618
*/
1719
final class AMFormatter implements CountryPostcodeFormatter
1820
{
19-
public function format(string $postcode) : ?string
21+
public function format(string $postcode): ?string
2022
{
2123
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
2224
return null;

src/Formatter/AQFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
final class AQFormatter implements CountryPostcodeFormatter
1717
{
18-
public function format(string $postcode) : ?string
18+
public function format(string $postcode): ?string
1919
{
2020
if ($postcode === 'BIQQ1ZZ') {
2121
return 'BIQQ 1ZZ';

src/Formatter/ARFormatter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
use Brick\Postcode\CountryPostcodeFormatter;
88

9+
use function preg_match;
10+
911
/**
1012
* Validates and formats postcodes in Argentina.
1113
*
@@ -16,7 +18,7 @@
1618
*/
1719
final class ARFormatter implements CountryPostcodeFormatter
1820
{
19-
public function format(string $postcode) : ?string
21+
public function format(string $postcode): ?string
2022
{
2123
if (preg_match('/^(([0-9]{4})|([A-Z][0-9]{4}[A-Z]{3}))$/', $postcode) !== 1) {
2224
return null;

src/Formatter/ASFormatter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
use Brick\Postcode\CountryPostcodeFormatter;
88

9+
use function preg_match;
10+
use function strlen;
11+
use function substr;
12+
913
/**
1014
* Validates and formats postcodes in American Samoa.
1115
*
@@ -17,7 +21,7 @@
1721
*/
1822
final class ASFormatter implements CountryPostcodeFormatter
1923
{
20-
public function format(string $postcode) : ?string
24+
public function format(string $postcode): ?string
2125
{
2226
$length = strlen($postcode);
2327

0 commit comments

Comments
 (0)