Skip to content

Commit

Permalink
Revert to normal properties
Browse files Browse the repository at this point in the history
The order is not the same as in the constructor, and that seems to
matter.
  • Loading branch information
greg0ire committed Jun 2, 2022
1 parent a870290 commit 4117209
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
26 changes: 16 additions & 10 deletions tests/Doctrine/Tests/Models/Navigation/NavPointOfInterest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
*/
class NavPointOfInterest
{
/**
* @Id
* @Column(type="integer", name="nav_long")
*/
private int $long;

/**
* @Id
* @Column(type="integer", name="nav_lat")
*/
private int $lat;

/**
* @psalm-var Collection<int, NavUser>
* @ManyToMany(targetEntity="NavUser", cascade={"persist"})
Expand All @@ -35,16 +47,8 @@ class NavPointOfInterest
private $visitors;

public function __construct(
/**
* @Id
* @Column(type="integer", name="nav_lat")
*/
private int $lat,
/**
* @Id
* @Column(type="integer", name="nav_long")
*/
private int $long,
int $lat,
int $long,
/**
* @Column(type="string", length=255)
*/
Expand All @@ -54,6 +58,8 @@ public function __construct(
*/
private NavCountry $country
) {
$this->lat = $lat;
$this->long = $long;
$this->visitors = new ArrayCollection();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function testCompositeCollectionMemberExpression(): void
public function testSpecifyUnknownIdentifierPrimaryKeyFails(): void
{
$this->expectException(MissingIdentifierField::class);
$this->expectExceptionMessage('The identifier lat is missing for a query of Doctrine\Tests\Models\Navigation\NavPointOfInterest');
$this->expectExceptionMessage('The identifier long is missing for a query of Doctrine\Tests\Models\Navigation\NavPointOfInterest');

$poi = $this->_em->find(NavPointOfInterest::class, ['key1' => 100]);
}
Expand Down

0 comments on commit 4117209

Please sign in to comment.