diff --git a/Tests/Swift/RegistryTest.php b/Tests/Swift/RegistryTest.php index 1462d01..67ded30 100644 --- a/Tests/Swift/RegistryTest.php +++ b/Tests/Swift/RegistryTest.php @@ -12,6 +12,7 @@ namespace Iban\Validation\Tests\Swift; use Iban\Validation\Swift\Exception\UnsupportedCountryCodeException; +use Iban\Validation\Swift\PhpRegistryLoader; use Iban\Validation\Swift\Registry; use Iban\Validation\Swift\RegistryLoader; use PHPUnit\Framework\TestCase; @@ -26,7 +27,7 @@ final class RegistryTest extends TestCase protected function setUp(): void { - $this->registry = new Registry(); + $this->registry = new Registry(new PhpRegistryLoader()); } public function testItShouldThrowExceptionForUnsupportedCountryCode() diff --git a/src/CountryInfo.php b/src/CountryInfo.php index 83de3e6..17d3a64 100644 --- a/src/CountryInfo.php +++ b/src/CountryInfo.php @@ -11,6 +11,7 @@ namespace Iban\Validation; use Iban\Validation\Swift\Exception\UnsupportedCountryCodeException; +use Iban\Validation\Swift\PhpRegistryLoader; use Iban\Validation\Swift\Registry; /** @@ -42,7 +43,7 @@ public function __construct($countryCode, $swiftRegistry = null) $this->swiftRegistry = $swiftRegistry; if (null === $swiftRegistry) { - $this->swiftRegistry = new Registry(); + $this->swiftRegistry = new Registry(new PhpRegistryLoader()); } if (!$this->swiftRegistry->isCountryAvailable($this->countryCode)) { diff --git a/src/Iban.php b/src/Iban.php index fe44623..d92935c 100644 --- a/src/Iban.php +++ b/src/Iban.php @@ -11,6 +11,7 @@ namespace Iban\Validation; +use Iban\Validation\Swift\PhpRegistryLoader; use Iban\Validation\Swift\Registry; /** @@ -142,7 +143,7 @@ public function getBbanBankIdentifier() { @trigger_error(sprintf('The "%s" method is deprecated since 1.7, use "%s::bbanBankIdentifier()" instead.', __METHOD__, Iban::class), E_USER_DEPRECATED); - $registry = new Registry(); + $registry = new Registry(new PhpRegistryLoader()); return substr( $this->bban(), @@ -153,7 +154,7 @@ public function getBbanBankIdentifier() public function bbanBankIdentifier(): string { - $registry = new Registry(); + $registry = new Registry(new PhpRegistryLoader()); return substr( $this->bban(), diff --git a/src/Validator.php b/src/Validator.php index 85ce4d1..40e8182 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -15,6 +15,7 @@ use Iban\Validation\Exception\InvalidFormatException; use Iban\Validation\Exception\InvalidLengthException; use Iban\Validation\Swift\Exception\UnsupportedCountryCodeException; +use Iban\Validation\Swift\PhpRegistryLoader; use Iban\Validation\Swift\Registry; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -83,7 +84,7 @@ public function __construct($options = [], $swiftRegistry = null) $this->swiftRegistry = $swiftRegistry; if (null === $swiftRegistry) { - $this->swiftRegistry = new Registry(); + $this->swiftRegistry = new Registry(new PhpRegistryLoader()); } $resolver = new OptionsResolver();