Skip to content

Commit

Permalink
Make sure no deprecation are triggered by internal code fixes #75 (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschaedl authored Jun 27, 2022
1 parent 8b635c4 commit ab8c4d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Tests/Swift/RegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion src/CountryInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Iban\Validation;

use Iban\Validation\Swift\Exception\UnsupportedCountryCodeException;
use Iban\Validation\Swift\PhpRegistryLoader;
use Iban\Validation\Swift\Registry;

/**
Expand Down Expand Up @@ -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)) {
Expand Down
5 changes: 3 additions & 2 deletions src/Iban.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Iban\Validation;

use Iban\Validation\Swift\PhpRegistryLoader;
use Iban\Validation\Swift\Registry;

/**
Expand Down Expand Up @@ -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(),
Expand All @@ -153,7 +154,7 @@ public function getBbanBankIdentifier()

public function bbanBankIdentifier(): string
{
$registry = new Registry();
$registry = new Registry(new PhpRegistryLoader());

return substr(
$this->bban(),
Expand Down
3 changes: 2 additions & 1 deletion src/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit ab8c4d6

Please sign in to comment.