Skip to content

Commit

Permalink
Fix: Run 'make coding-standards'
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Aug 9, 2021
1 parent d53a746 commit 1c01e09
Show file tree
Hide file tree
Showing 59 changed files with 321 additions and 321 deletions.
4 changes: 2 additions & 2 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ $license = License\Type\MIT::markdown(
__DIR__ . '/LICENSE.md',
License\Range::since(
License\Year::fromString('2020'),
new \DateTimeZone('UTC')
new \DateTimeZone('UTC'),
),
License\Holder::fromString('Andreas Möller'),
License\Url::fromString('https://github.com/ergebnis/factory-bot')
License\Url::fromString('https://github.com/ergebnis/factory-bot'),
);

$license->save();
Expand Down
12 changes: 6 additions & 6 deletions example/test/AutoReview/FixtureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public function testEntitiesHaveEntityDefinitionProviders(): void
return \str_replace(
'Example\\Entity\\',
'Example\\Test\\Fixture\\Entity\\',
$entityClassName
$entityClassName,
) . 'DefinitionProvider';
}, $entityClassNames)
}, $entityClassNames),
);

self::assertIsArray($expectedProviderClassNames);
Expand All @@ -57,7 +57,7 @@ public function testEntitiesHaveEntityDefinitionProviders(): void

$missingProviderClassNames = \array_diff(
$expectedProviderClassNames,
$actualProviderClassNames
$actualProviderClassNames,
);

$message = \sprintf(
Expand All @@ -74,13 +74,13 @@ public function testEntitiesHaveEntityDefinitionProviders(): void
,
\implode(
\PHP_EOL . ' - ',
\array_keys($missingProviderClassNames)
\array_keys($missingProviderClassNames),
),
FactoryBot\EntityDefinitionProvider::class,
\implode(
\PHP_EOL . ' - ',
$missingProviderClassNames
)
$missingProviderClassNames,
),
);

self::assertEmpty($missingProviderClassNames, $message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function accept(FactoryBot\FixtureFactory $fixtureFactory): void
}),
'members' => FactoryBot\FieldDefinition::references(
Entity\User::class,
FactoryBot\Count::between(1, 10)
FactoryBot\Count::between(1, 10),
),
'name' => FactoryBot\FieldDefinition::closure(static function (Generator $faker): string {
return $faker->word;
Expand Down
6 changes: 3 additions & 3 deletions example/test/Unit/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ final protected static function entityManager(): ORM\EntityManagerInterface
true,
null,
null,
false
false,
);

$entityManager = ORM\EntityManager::create(
[
'driver' => 'pdo_sqlite',
'path' => ':memory:',
],
$configuration
$configuration,
);

$schemaTool = new ORM\Tools\SchemaTool($entityManager);
Expand All @@ -64,7 +64,7 @@ final protected static function fixtureFactory(): FactoryBot\FixtureFactory
{
$fixtureFactory = new FactoryBot\FixtureFactory(
self::entityManager(),
self::faker()
self::faker(),
);

$fixtureFactory->load(__DIR__ . '/../Fixture');
Expand Down
6 changes: 3 additions & 3 deletions src/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function exact(int $value): self

return new self(
$value,
$value
$value,
);
}

Expand All @@ -59,13 +59,13 @@ public static function between(int $minimum, int $maximum): self
if ($maximum <= $minimum) {
throw Exception\InvalidMaximum::notGreaterThanMinimum(
$minimum,
$maximum
$maximum,
);
}

return new self(
$minimum,
$maximum
$maximum,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ClassMetadataNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function for(string $className): self
{
return new self(\sprintf(
'Class metadata for a class with the name "%s" could not be found.',
$className
$className,
));
}
}
2 changes: 1 addition & 1 deletion src/Exception/ClassNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function name(string $className): self
{
return new self(\sprintf(
'A class with the name "%s" could not be found.',
$className
$className,
));
}
}
2 changes: 1 addition & 1 deletion src/Exception/EntityDefinitionAlreadyRegistered.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function for(string $className): self
{
return new self(\sprintf(
'An entity definition for class name "%s" has already been registered.',
$className
$className,
));
}
}
2 changes: 1 addition & 1 deletion src/Exception/EntityDefinitionNotRegistered.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function for(string $className): self
{
return new self(\sprintf(
'An entity definition for class name "%s" has not been registered.',
$className
$className,
));
}
}
2 changes: 1 addition & 1 deletion src/Exception/InvalidCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function notGreaterThanOrEqualToZero(int $count): self
{
return new self(\sprintf(
'Count needs to be greater than or equal to 0, but %d is not.',
$count
$count,
));
}
}
8 changes: 4 additions & 4 deletions src/Exception/InvalidDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public static function canNotBeAutoloaded(string $className): self
{
return new self(\sprintf(
'Definition "%s" can not be autoloaded.',
$className
$className,
));
}

public static function canNotBeInstantiated(string $className): self
{
return new self(\sprintf(
'Definition "%s" can not be instantiated.',
$className
$className,
));
}

Expand All @@ -36,10 +36,10 @@ public static function throwsExceptionDuringInstantiation(string $className, \Ex
return new self(
\sprintf(
'An exception was thrown while trying to instantiate definition "%s".',
$className
$className,
),
0,
$exception
$exception,
);
}
}
2 changes: 1 addition & 1 deletion src/Exception/InvalidDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function notDirectory(string $directory): self
{
return new self(\sprintf(
'Directory should be a directory, but "%s" is not.',
$directory
$directory,
));
}
}
2 changes: 1 addition & 1 deletion src/Exception/InvalidFieldDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static function values(): self
{
return new self(\sprintf(
'Field definitions need to be instances of "%s".',
FieldDefinition::class
FieldDefinition::class,
));
}
}
2 changes: 1 addition & 1 deletion src/Exception/InvalidFieldNames.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static function notFoundIn(string $className, string ...$fieldNames): sel
return new self(\sprintf(
$template,
$className,
\implode('", "', $fieldNames)
\implode('", "', $fieldNames),
));
}
}
2 changes: 1 addition & 1 deletion src/Exception/InvalidMaximum.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function notGreaterThanMinimum(int $minimum, int $maximum): self
return new self(\sprintf(
'Maximum needs to be greater than minimum %d, but %d is not.',
$minimum,
$maximum
$maximum,
));
}
}
2 changes: 1 addition & 1 deletion src/Exception/InvalidMinimum.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function notGreaterThanOrEqualToZero(int $minimum): self
{
return new self(\sprintf(
'Minimum needs to be greater than or equal to 0, but %d is not.',
$minimum
$minimum,
));
}
}
2 changes: 1 addition & 1 deletion src/Exception/InvalidSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function value(string $value): self
{
return new self(\sprintf(
'Value needs to contain a placeholder "%%d", but "%s" does not',
$value
$value,
));
}
}
6 changes: 3 additions & 3 deletions src/FieldDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function references(string $className, Count $count): FieldDefinit
{
return new FieldDefinition\References(
$className,
$count
$count,
);
}

Expand All @@ -73,15 +73,15 @@ public static function sequence(string $value, int $initialNumber = 1): FieldDef
{
return new FieldDefinition\Sequence(
$value,
$initialNumber
$initialNumber,
);
}

public static function optionalSequence(string $value, int $initialNumber = 1): FieldDefinition\Resolvable
{
return new FieldDefinition\Optional(new FieldDefinition\Sequence(
$value,
$initialNumber
$initialNumber,
));
}

Expand Down
2 changes: 1 addition & 1 deletion src/FieldDefinition/Closure.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function resolve(Generator $faker, FixtureFactory $fixtureFactory)

return $closure(
$faker,
$fixtureFactory
$fixtureFactory,
);
}
}
2 changes: 1 addition & 1 deletion src/FieldDefinition/Optional.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function resolve(Generator $faker, FixtureFactory $fixtureFactory)
{
return $this->resolvable->resolve(
$faker,
$fixtureFactory
$fixtureFactory,
);
}
}
2 changes: 1 addition & 1 deletion src/FieldDefinition/References.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function resolve(Generator $faker, FixtureFactory $fixtureFactory): array
{
return $fixtureFactory->createMany(
$this->className,
$this->count
$this->count,
);
}
}
2 changes: 1 addition & 1 deletion src/FieldDefinition/Sequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function resolve(Generator $faker, FixtureFactory $fixtureFactory): strin
return \str_replace(
'%d',
(string) $this->sequentialNumber++,
$this->value
$this->value,
);
}
}
Loading

0 comments on commit 1c01e09

Please sign in to comment.