Skip to content

Commit

Permalink
Merge pull request #13 from xefi/fix-trait-inheritance
Browse files Browse the repository at this point in the history
🐛 trait inheritance
  • Loading branch information
GautierDele authored Oct 22, 2024
2 parents 2916b13 + ab54ca4 commit 637a66d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions src/Container/Traits/HasExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
namespace Xefi\Faker\Container\Traits;

use Random\Randomizer;
use ReflectionClass;
use Xefi\Faker\Container\Container;
use Xefi\Faker\Exceptions\NoExtensionLocaleFound;
use Xefi\Faker\Extensions\Extension;
use Xefi\Faker\Extensions\Traits\HasLocale;

trait HasExtensions
{
Expand Down Expand Up @@ -53,10 +51,7 @@ protected function resolve(\Xefi\Faker\Extensions\Extension|string $extension):
$instance = $extension instanceof Extension ? $extension : new $extension(new Randomizer());

// If the extension supports locale variations
if (in_array(
HasLocale::class,
array_keys((new ReflectionClass($instance::class))->getTraits())
)) {
if (method_exists($instance, 'getLocale')) {
return $this->addLocaleExtension($instance);
}

Expand Down
1 change: 0 additions & 1 deletion tests/Unit/Extensions/FinancialExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

final class FinancialExtensionTest extends TestCase
{
#[RepeatedTest(5)]
public function testIban()
{
$iban = $this->faker->iban();
Expand Down

0 comments on commit 637a66d

Please sign in to comment.