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

brick / postcode / 21922441590

11 Feb 2026 08:46PM UTC coverage: 99.394% (-0.002%) from 99.396%
21922441590

push

github

BenMorel
Reorganize exceptions

2 of 5 new or added lines in 2 files covered. (40.0%)

820 of 825 relevant lines covered (99.39%)

18.38 hits per line

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

33.33
/src/Exception/InvalidPostcodeException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Postcode\Exception;
6

7
/**
8
 * Exception thrown when trying to format an invalid postcode.
9
 */
10
final class InvalidPostcodeException extends PostcodeException
11
{
12
    public function __construct(
13
        private readonly string $postcode,
14
        private readonly string $country,
15
    ) {
16
        parent::__construct('Invalid postcode: ' . $postcode);
4✔
17
    }
18

19
    /**
20
     * Returns the invalid postcode that triggered this exception.
21
     */
22
    public function getPostcode(): string
23
    {
NEW
24
        return $this->postcode;
×
25
    }
26

27
    /**
28
     * Returns the ISO country code used to format the postcode.
29
     */
30
    public function getCountry(): string
31
    {
NEW
32
        return $this->country;
×
33
    }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc