Skip to content

Commit

Permalink
Merge pull request #42 from ergebnis/fix/spelling
Browse files Browse the repository at this point in the history
Fix: Rename SpaceShip to Spaceship
  • Loading branch information
localheinz authored Mar 14, 2020
2 parents 79b7135 + ba36eac commit 814d9bf
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 162 deletions.
70 changes: 35 additions & 35 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ parameters:
path: test/Fixture/FixtureFactory/Entity/Person.php

-
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person\\:\\:\\$spaceShip has no typehint specified\\.$#"
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person\\:\\:\\$spaceship has no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/Person.php

-
message: "#^Constructor in Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person has parameter \\$spaceShip with default value\\.$#"
message: "#^Constructor in Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person has parameter \\$spaceship with default value\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/Person.php

Expand All @@ -221,12 +221,12 @@ parameters:
path: test/Fixture/FixtureFactory/Entity/Person.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person\\:\\:__construct\\(\\) has parameter \\$spaceShip with a nullable type declaration\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person\\:\\:__construct\\(\\) has parameter \\$spaceship with a nullable type declaration\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/Person.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person\\:\\:__construct\\(\\) has parameter \\$spaceShip with null as default value\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person\\:\\:__construct\\(\\) has parameter \\$spaceship with null as default value\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/Person.php

Expand All @@ -241,84 +241,84 @@ parameters:
path: test/Fixture/FixtureFactory/Entity/Person.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person\\:\\:getSpaceShip\\(\\) has no return typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Person\\:\\:getSpaceship\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/Person.php

-
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceShip\\:\\:\\$id has no typehint specified\\.$#"
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:\\$id has no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceShip.php
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php

-
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceShip\\:\\:\\$name has no typehint specified\\.$#"
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:\\$name has no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceShip.php
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php

-
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceShip\\:\\:\\$crew has no typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:__construct\\(\\) has parameter \\$name with no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceShip.php
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceShip\\:\\:__construct\\(\\) has parameter \\$name with no typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:getId\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceShip.php
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceShip\\:\\:getId\\(\\) has no return typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:getName\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceShip.php
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceShip\\:\\:getName\\(\\) has no return typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:setName\\(\\) has parameter \\$name with no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceShip.php
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceShip\\:\\:setName\\(\\) has parameter \\$name with no typehint specified\\.$#"
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:\\$id has no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceShip.php
path: test/Fixture/FixtureFactory/Entity/Spaceship.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceShip\\:\\:getCrew\\(\\) has no return typehint specified\\.$#"
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:\\$name has no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceShip.php
path: test/Fixture/FixtureFactory/Entity/Spaceship.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceShip\\:\\:constructorWasCalled\\(\\) has no return typehint specified\\.$#"
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:\\$crew has no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceShip.php
path: test/Fixture/FixtureFactory/Entity/Spaceship.php

-
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:\\$id has no typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:__construct\\(\\) has parameter \\$name with no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php
path: test/Fixture/FixtureFactory/Entity/Spaceship.php

-
message: "#^Property Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:\\$name has no typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:getId\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php
path: test/Fixture/FixtureFactory/Entity/Spaceship.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:__construct\\(\\) has parameter \\$name with no typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:getName\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php
path: test/Fixture/FixtureFactory/Entity/Spaceship.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:getId\\(\\) has no return typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:setName\\(\\) has parameter \\$name with no typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php
path: test/Fixture/FixtureFactory/Entity/Spaceship.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:getName\\(\\) has no return typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:getCrew\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php
path: test/Fixture/FixtureFactory/Entity/Spaceship.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\SpaceStation\\:\\:setName\\(\\) has parameter \\$name with no typehint specified\\.$#"
message: "#^Method Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Spaceship\\:\\:constructorWasCalled\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Fixture/FixtureFactory/Entity/SpaceStation.php
path: test/Fixture/FixtureFactory/Entity/Spaceship.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Ergebnis\\\\\\\\FactoryBot…' and Ergebnis\\\\FactoryBot\\\\Test\\\\Fixture\\\\FixtureFactory\\\\Entity\\\\Name will always evaluate to true\\.$#"
Expand Down
18 changes: 9 additions & 9 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,29 +163,29 @@
<MissingReturnType occurrences="3">
<code>getId</code>
<code>getName</code>
<code>getSpaceShip</code>
<code>getSpaceship</code>
</MissingReturnType>
</file>
<file src="test/Fixture/FixtureFactory/Entity/SpaceShip.php">
<file src="test/Fixture/FixtureFactory/Entity/SpaceStation.php">
<MissingParamType occurrences="2">
<code>$name</code>
<code>$name</code>
</MissingParamType>
<MissingReturnType occurrences="4">
<MissingReturnType occurrences="2">
<code>getId</code>
<code>getName</code>
<code>getCrew</code>
<code>constructorWasCalled</code>
</MissingReturnType>
</file>
<file src="test/Fixture/FixtureFactory/Entity/SpaceStation.php">
<file src="test/Fixture/FixtureFactory/Entity/Spaceship.php">
<MissingParamType occurrences="2">
<code>$name</code>
<code>$name</code>
</MissingParamType>
<MissingReturnType occurrences="2">
<MissingReturnType occurrences="4">
<code>getId</code>
<code>getName</code>
<code>getCrew</code>
<code>constructorWasCalled</code>
</MissingReturnType>
</file>
<file src="test/Integration/FixtureFactoryTest.php">
Expand All @@ -207,8 +207,8 @@
<code>$n</code>
</MissingClosureParamType>
<MixedArgument occurrences="2">
<code>$fixtureFactory-&gt;getList(Fixture\FixtureFactory\Entity\SpaceShip::class)</code>
<code>$fixtureFactory-&gt;getList(Fixture\FixtureFactory\Entity\SpaceShip::class, [], 5)</code>
<code>$fixtureFactory-&gt;getList(Fixture\FixtureFactory\Entity\Spaceship::class)</code>
<code>$fixtureFactory-&gt;getList(Fixture\FixtureFactory\Entity\Spaceship::class, [], 5)</code>
</MixedArgument>
<MixedAssignment occurrences="23">
<code>$ss</code>
Expand Down
14 changes: 7 additions & 7 deletions test/Fixture/FixtureFactory/Entity/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ class Person

/**
* @ORM\ManyToOne(
* targetEntity="Ergebnis\FactoryBot\Test\Fixture\FixtureFactory\Entity\SpaceShip",
* targetEntity="Spaceship",
* inversedBy="crew"
* )
* @ORM\JoinColumn(
* name="spaceShip_id",
* name="spaceship_id",
* referencedColumnName="id",
* nullable=true
* )
*/
protected $spaceShip;
protected $spaceship;

public function __construct($name, ?SpaceShip $spaceShip = null)
public function __construct($name, ?Spaceship $spaceship = null)
{
$this->name = $name;
$this->spaceShip = $spaceShip;
$this->spaceship = $spaceship;
}

public function getId()
Expand All @@ -62,8 +62,8 @@ public function getName()
return $this->name;
}

public function getSpaceShip()
public function getSpaceship()
{
return $this->spaceShip;
return $this->spaceship;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @ORM\Entity
* @ORM\Table(name="space_ship")
*/
class SpaceShip
class Spaceship
{
/**
* @ORM\Id
Expand All @@ -37,7 +37,7 @@ class SpaceShip
/**
* @ORM\OneToMany(
* targetEntity="Ergebnis\FactoryBot\Test\Fixture\FixtureFactory\Entity\Person",
* mappedBy="spaceShip"
* mappedBy="spaceship"
* )
*/
protected $crew;
Expand Down
12 changes: 6 additions & 6 deletions test/Integration/FixtureFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public function testAutomaticPersistCanBeTurnedOn(): void

$fixtureFactory = new FixtureFactory($entityManager);

$fixtureFactory->defineEntity(Fixture\FixtureFactory\Entity\SpaceShip::class, ['name' => 'Zeta']);
$fixtureFactory->defineEntity(Fixture\FixtureFactory\Entity\Spaceship::class, ['name' => 'Zeta']);

$fixtureFactory->persistOnGet();

$ss = $fixtureFactory->get(Fixture\FixtureFactory\Entity\SpaceShip::class);
$ss = $fixtureFactory->get(Fixture\FixtureFactory\Entity\Spaceship::class);
$entityManager->flush();

self::assertNotNull($ss->getId());
self::assertSame($ss, $entityManager->find(Fixture\FixtureFactory\Entity\SpaceShip::class, $ss->getId()));
self::assertSame($ss, $entityManager->find(Fixture\FixtureFactory\Entity\Spaceship::class, $ss->getId()));
}

public function testDoesNotPersistByDefault(): void
Expand All @@ -48,17 +48,17 @@ public function testDoesNotPersistByDefault(): void

$fixtureFactory = new FixtureFactory($entityManager);

$fixtureFactory->defineEntity(Fixture\FixtureFactory\Entity\SpaceShip::class, ['name' => 'Zeta']);
$fixtureFactory->defineEntity(Fixture\FixtureFactory\Entity\Spaceship::class, ['name' => 'Zeta']);

$ss = $fixtureFactory->get(Fixture\FixtureFactory\Entity\SpaceShip::class);
$ss = $fixtureFactory->get(Fixture\FixtureFactory\Entity\Spaceship::class);

$entityManager->flush();

self::assertNull($ss->getId());
$q = $entityManager
->createQueryBuilder()
->select('ss')
->from(Fixture\FixtureFactory\Entity\SpaceShip::class, 'ss')
->from(Fixture\FixtureFactory\Entity\Spaceship::class, 'ss')
->getQuery();
self::assertEmpty($q->getResult());
}
Expand Down
Loading

0 comments on commit 814d9bf

Please sign in to comment.