Skip to content

Commit

Permalink
Merge pull request #1371 from ergebnis/fix/move
Browse files Browse the repository at this point in the history
Fix: Move classes
  • Loading branch information
localheinz committed May 1, 2024
2 parents 14f0daa + ad5e6f3 commit 6648c60
Show file tree
Hide file tree
Showing 18 changed files with 265 additions and 265 deletions.
412 changes: 206 additions & 206 deletions psalm-baseline.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @see https://github.com/ergebnis/factory-bot
*/

namespace Ergebnis\FactoryBot\Strategy;
namespace Ergebnis\FactoryBot\FieldResolution;

use Ergebnis\FactoryBot\Count;
use Ergebnis\FactoryBot\FieldDefinition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @see https://github.com/ergebnis/factory-bot
*/

namespace Ergebnis\FactoryBot\Strategy;
namespace Ergebnis\FactoryBot\FieldResolution;

use Ergebnis\FactoryBot\Count;
use Ergebnis\FactoryBot\FieldDefinition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @see https://github.com/ergebnis/factory-bot
*/

namespace Ergebnis\FactoryBot\Strategy;
namespace Ergebnis\FactoryBot\FieldResolution;

use Ergebnis\FactoryBot\Count;
use Ergebnis\FactoryBot\FieldDefinition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @see https://github.com/ergebnis/factory-bot
*/

namespace Ergebnis\FactoryBot\Strategy;
namespace Ergebnis\FactoryBot\FieldResolution;

use Ergebnis\FactoryBot\Count;
use Ergebnis\FactoryBot\FieldDefinition;
Expand Down
8 changes: 4 additions & 4 deletions src/FixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

final class FixtureFactory
{
private Strategy\ResolutionStrategy $resolutionStrategy;
private FieldResolution\ResolutionStrategy $resolutionStrategy;
private bool $persistAfterCreate = false;

/**
Expand All @@ -32,7 +32,7 @@ public function __construct(
private ORM\EntityManagerInterface $entityManager,
private Generator $faker,
) {
$this->resolutionStrategy = new Strategy\DefaultStrategy();
$this->resolutionStrategy = new FieldResolution\DefaultStrategy();
}

/**
Expand Down Expand Up @@ -325,7 +325,7 @@ public function withOptional(): self
{
$instance = clone $this;

$instance->resolutionStrategy = new Strategy\WithOptionalStrategy();
$instance->resolutionStrategy = new FieldResolution\WithOptionalStrategy();

return $instance;
}
Expand All @@ -342,7 +342,7 @@ public function withoutOptional(): self
{
$instance = clone $this;

$instance->resolutionStrategy = new Strategy\WithoutOptionalStrategy();
$instance->resolutionStrategy = new FieldResolution\WithoutOptionalStrategy();

return $instance;
}
Expand Down
4 changes: 2 additions & 2 deletions test/Integration/FixtureFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
use Ergebnis\FactoryBot\Count;
use Ergebnis\FactoryBot\EntityDefinition;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\FactoryBot\FieldResolution;
use Ergebnis\FactoryBot\FixtureFactory;
use Ergebnis\FactoryBot\Strategy;
use Example\Entity;
use Faker\Generator;
use PHPUnit\Framework;
Expand All @@ -30,7 +30,7 @@
#[Framework\Attributes\UsesClass(FieldDefinition\Reference::class)]
#[Framework\Attributes\UsesClass(FieldDefinition\Sequence::class)]
#[Framework\Attributes\UsesClass(FieldDefinition\Value::class)]
#[Framework\Attributes\UsesClass(Strategy\DefaultStrategy::class)]
#[Framework\Attributes\UsesClass(FieldResolution\DefaultStrategy::class)]
final class FixtureFactoryTest extends AbstractTestCase
{
public function testCreateOneDoesNotPersistEntityByDefault(): void
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/FieldDefinition/ClosureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

use Ergebnis\FactoryBot\EntityDefinition;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\FactoryBot\FieldResolution;
use Ergebnis\FactoryBot\FixtureFactory;
use Ergebnis\FactoryBot\Strategy;
use Ergebnis\FactoryBot\Test;
use Example\Entity;
use Faker\Generator;
Expand All @@ -27,7 +27,7 @@
#[Framework\Attributes\UsesClass(FieldDefinition::class)]
#[Framework\Attributes\UsesClass(FieldDefinition\Value::class)]
#[Framework\Attributes\UsesClass(FixtureFactory::class)]
#[Framework\Attributes\UsesClass(Strategy\DefaultStrategy::class)]
#[Framework\Attributes\UsesClass(FieldResolution\DefaultStrategy::class)]
final class ClosureTest extends Test\Unit\AbstractTestCase
{
public function testResolvesToResultOfInvokingClosureWithFakerAndFixtureFactory(): void
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/FieldDefinition/OptionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

use Ergebnis\FactoryBot\EntityDefinition;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\FactoryBot\FieldResolution;
use Ergebnis\FactoryBot\FixtureFactory;
use Ergebnis\FactoryBot\Strategy;
use Ergebnis\FactoryBot\Test;
use Example\Entity;
use Faker\Generator;
Expand All @@ -27,7 +27,7 @@
#[Framework\Attributes\UsesClass(FieldDefinition::class)]
#[Framework\Attributes\UsesClass(FieldDefinition\Value::class)]
#[Framework\Attributes\UsesClass(FixtureFactory::class)]
#[Framework\Attributes\UsesClass(Strategy\DefaultStrategy::class)]
#[Framework\Attributes\UsesClass(FieldResolution\DefaultStrategy::class)]
final class OptionalTest extends Test\Unit\AbstractTestCase
{
public function testResolvesToResultOfResolvingResolvableWithFixtureFactory(): void
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/FieldDefinition/ReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

use Ergebnis\FactoryBot\EntityDefinition;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\FactoryBot\FieldResolution;
use Ergebnis\FactoryBot\FixtureFactory;
use Ergebnis\FactoryBot\Strategy;
use Ergebnis\FactoryBot\Test;
use Example\Entity;
use PHPUnit\Framework;
Expand All @@ -26,7 +26,7 @@
#[Framework\Attributes\UsesClass(FieldDefinition::class)]
#[Framework\Attributes\UsesClass(FieldDefinition\Value::class)]
#[Framework\Attributes\UsesClass(FixtureFactory::class)]
#[Framework\Attributes\UsesClass(Strategy\DefaultStrategy::class)]
#[Framework\Attributes\UsesClass(FieldResolution\DefaultStrategy::class)]
final class ReferenceTest extends Test\Unit\AbstractTestCase
{
public function testResolvesToObjectCreatedByFixtureFactory(): void
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/FieldDefinition/ReferencesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
use Ergebnis\FactoryBot\EntityDefinition;
use Ergebnis\FactoryBot\Exception;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\FactoryBot\FieldResolution;
use Ergebnis\FactoryBot\FixtureFactory;
use Ergebnis\FactoryBot\Strategy;
use Ergebnis\FactoryBot\Test;
use Example\Entity;
use PHPUnit\Framework;
Expand All @@ -30,7 +30,7 @@
#[Framework\Attributes\UsesClass(FieldDefinition::class)]
#[Framework\Attributes\UsesClass(FieldDefinition\Value::class)]
#[Framework\Attributes\UsesClass(FixtureFactory::class)]
#[Framework\Attributes\UsesClass(Strategy\DefaultStrategy::class)]
#[Framework\Attributes\UsesClass(FieldResolution\DefaultStrategy::class)]
final class ReferencesTest extends Test\Unit\AbstractTestCase
{
#[Framework\Attributes\DataProviderExternal(Test\DataProvider\IntProvider::class, 'greaterThanOrEqualToZero')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
* @see https://github.com/ergebnis/factory-bot
*/

namespace Ergebnis\FactoryBot\Test\Unit\Strategy;
namespace Ergebnis\FactoryBot\Test\Unit\FieldResolution;

use Ergebnis\FactoryBot\Count;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\FactoryBot\FieldResolution;
use Ergebnis\FactoryBot\FixtureFactory;
use Ergebnis\FactoryBot\Strategy;
use Ergebnis\FactoryBot\Test;
use PHPUnit\Framework;

#[Framework\Attributes\CoversClass(Strategy\DefaultStrategy::class)]
#[Framework\Attributes\CoversClass(FieldResolution\DefaultStrategy::class)]
#[Framework\Attributes\UsesClass(Count::class)]
#[Framework\Attributes\UsesClass(FieldDefinition::class)]
#[Framework\Attributes\UsesClass(FieldDefinition\Optional::class)]
Expand All @@ -39,7 +39,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionWithFakerAnd

$fieldDefinition = FieldDefinition::optionalValue($faker->sentence());

$strategy = new Strategy\DefaultStrategy();
$strategy = new FieldResolution\DefaultStrategy();

$resolved = $strategy->resolveFieldValue(
new Test\Double\Faker\TrueGenerator(),
Expand All @@ -66,7 +66,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionToNullWhenFa

$fieldDefinition = FieldDefinition::optionalValue($faker->sentence());

$strategy = new Strategy\DefaultStrategy();
$strategy = new FieldResolution\DefaultStrategy();

$resolved = $strategy->resolveFieldValue(
new Test\Double\Faker\FalseGenerator(),
Expand All @@ -88,7 +88,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF

$fieldDefinition = FieldDefinition::value($faker->sentence());

$strategy = new Strategy\DefaultStrategy();
$strategy = new FieldResolution\DefaultStrategy();

$resolved = $strategy->resolveFieldValue(
new Test\Double\Faker\TrueGenerator(),
Expand All @@ -115,7 +115,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF

$fieldDefinition = FieldDefinition::value($faker->sentence());

$strategy = new Strategy\DefaultStrategy();
$strategy = new FieldResolution\DefaultStrategy();

$resolved = $strategy->resolveFieldValue(
new Test\Double\Faker\FalseGenerator(),
Expand All @@ -134,7 +134,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF
#[Framework\Attributes\DataProviderExternal(Test\DataProvider\IntProvider::class, 'greaterThanOrEqualToZero')]
public function testResolveCountResolvesCountWithFakerWhenCountIsExact(int $value): void
{
$strategy = new Strategy\DefaultStrategy();
$strategy = new FieldResolution\DefaultStrategy();

$resolved = $strategy->resolveCount(
self::faker(),
Expand All @@ -149,7 +149,7 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetweenAndFaker
{
$maximum = self::faker()->numberBetween($minimum + 1);

$strategy = new Strategy\DefaultStrategy();
$strategy = new FieldResolution\DefaultStrategy();

$resolved = $strategy->resolveCount(
new Test\Double\Faker\MinimumGenerator(),
Expand All @@ -167,7 +167,7 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetweenAndFaker
{
$minimum = self::faker()->numberBetween(0, $maximum - 1);

$strategy = new Strategy\DefaultStrategy();
$strategy = new FieldResolution\DefaultStrategy();

$resolved = $strategy->resolveCount(
new Test\Double\Faker\MaximumGenerator(),
Expand All @@ -187,7 +187,7 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetween(): void
$minimum = $faker->numberBetween(1);
$maximum = $faker->numberBetween($minimum + 1);

$strategy = new Strategy\DefaultStrategy();
$strategy = new FieldResolution\DefaultStrategy();

$resolved = $strategy->resolveCount(
$faker,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
* @see https://github.com/ergebnis/factory-bot
*/

namespace Ergebnis\FactoryBot\Test\Unit\Strategy;
namespace Ergebnis\FactoryBot\Test\Unit\FieldResolution;

use Ergebnis\FactoryBot\Count;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\FactoryBot\FieldResolution;
use Ergebnis\FactoryBot\FixtureFactory;
use Ergebnis\FactoryBot\Strategy;
use Ergebnis\FactoryBot\Test;
use PHPUnit\Framework;

#[Framework\Attributes\CoversClass(Strategy\WithOptionalStrategy::class)]
#[Framework\Attributes\CoversClass(FieldResolution\WithOptionalStrategy::class)]
#[Framework\Attributes\UsesClass(Count::class)]
#[Framework\Attributes\UsesClass(FieldDefinition::class)]
#[Framework\Attributes\UsesClass(FieldDefinition\Optional::class)]
Expand All @@ -39,7 +39,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionWithFakerAnd

$fieldDefinition = FieldDefinition::optionalValue($faker->sentence());

$strategy = new Strategy\WithOptionalStrategy();
$strategy = new FieldResolution\WithOptionalStrategy();

$resolved = $strategy->resolveFieldValue(
new Test\Double\Faker\TrueGenerator(),
Expand All @@ -66,7 +66,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionWithFakerAnd

$fieldDefinition = FieldDefinition::optionalValue($faker->sentence());

$strategy = new Strategy\WithOptionalStrategy();
$strategy = new FieldResolution\WithOptionalStrategy();

$resolved = $strategy->resolveFieldValue(
new Test\Double\Faker\FalseGenerator(),
Expand All @@ -93,7 +93,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF

$fieldDefinition = FieldDefinition::value($faker->sentence());

$strategy = new Strategy\WithOptionalStrategy();
$strategy = new FieldResolution\WithOptionalStrategy();

$resolved = $strategy->resolveFieldValue(
new Test\Double\Faker\TrueGenerator(),
Expand All @@ -120,7 +120,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF

$fieldDefinition = FieldDefinition::value($faker->sentence());

$strategy = new Strategy\WithOptionalStrategy();
$strategy = new FieldResolution\WithOptionalStrategy();

$resolved = $strategy->resolveFieldValue(
new Test\Double\Faker\FalseGenerator(),
Expand All @@ -141,7 +141,7 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsExact(int $valu
{
$faker = self::faker();

$strategy = new Strategy\WithOptionalStrategy();
$strategy = new FieldResolution\WithOptionalStrategy();

$resolved = $strategy->resolveCount(
$faker,
Expand All @@ -156,7 +156,7 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetweenAndFaker
{
$maximum = self::faker()->numberBetween($minimum + 1);

$strategy = new Strategy\WithOptionalStrategy();
$strategy = new FieldResolution\WithOptionalStrategy();

$resolved = $strategy->resolveCount(
new Test\Double\Faker\MinimumGenerator(),
Expand All @@ -179,7 +179,7 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetweenAndFaker
{
$minimum = self::faker()->numberBetween(0, $maximum - 1);

$strategy = new Strategy\WithOptionalStrategy();
$strategy = new FieldResolution\WithOptionalStrategy();

$resolved = $strategy->resolveCount(
new Test\Double\Faker\MaximumGenerator(),
Expand All @@ -199,7 +199,7 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetween(): void
$minimum = $faker->numberBetween(1);
$maximum = $faker->numberBetween($minimum + 1);

$strategy = new Strategy\WithOptionalStrategy();
$strategy = new FieldResolution\WithOptionalStrategy();

$resolved = $strategy->resolveCount(
$faker,
Expand Down

0 comments on commit 6648c60

Please sign in to comment.