• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

brick / postcode / 19098978650

05 Nov 2025 10:29AM UTC coverage: 81.719% (-17.7%) from 99.396%
19098978650

Pull #19

github

web-flow
Merge 3d57d0d25 into 8ef37e5aa
Pull Request #19: Add hint to formatter, so a hint can be provided if postcode is invalid

6 of 186 new or added lines in 184 files covered. (3.23%)

827 of 1012 relevant lines covered (81.72%)

15.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.14
/src/InvalidPostcodeException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Postcode;
6

7
use Exception;
8

9
/**
10
 * Exception thrown when trying to format an invalid postcode.
11
 */
12
final class InvalidPostcodeException extends Exception
13
{
14
    protected string $postcode;
15

16
    protected string $country;
17

18
    protected string $hint;
19

20
    /**
21
     * Construct exception thrown when trying to format an invalid postcode.
22
     */
23
    public function __construct(string $postcode, string $country, string $hint)
24
    {
25
        parent::__construct('Invalid postcode: ' . $postcode);
4✔
26
        $this->postcode = $postcode;
4✔
27
        $this->country = $country;
4✔
28
        $this->hint = $hint;
4✔
29
    }
30

31
    /**
32
     * Get the invalid postcode associated with this exception.
33
     */
34
    public function getPostcode(): string
35
    {
36
        return $this->postcode;
×
37
    }
38

39
    /**
40
     * Get the country ISO2 code associated with this exception.
41
     */
42
    public function getCountry(): string
43
    {
44
        return $this->country;
×
45
    }
46

47
    /**
48
     * Get the hint associated with this exception.
49
     */
50
    public function getHint(): string
51
    {
NEW
52
        return $this->hint;
×
53
    }
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc