Skip to content

[make:entity] Change getter PHPDoc return type on Collection #1040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Util/ClassSourceManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ private function addCollectionRelation(BaseCollectionRelation $relation): void
$collectionTypeHint,
false,
// add @return that advertises this as a collection of specific objects
[sprintf('@return %s|%s[]', $collectionTypeHint, $typeHint)]
[sprintf('@return %s<int, %s>', $collectionTypeHint, $typeHint)]
);

$argName = Str::pluralCamelCaseToSingular($relation->getPropertyName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function setApiKey(string $apiKey): self
}

/**
* @return Collection|Tag[]
* @return Collection<int, Tag>
*/
public function getTags(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function setUserProfile(?UserProfile $userProfile)
}

/**
* @return Collection|UserAvatar[]
* @return Collection<int, UserAvatar>
*/
public function getAvatars(): Collection
{
Expand Down Expand Up @@ -91,7 +91,7 @@ public function getUserProfile(): ?UserProfile
}

/**
* @return Collection|Tag[]
* @return Collection<int, Tag>
*/
public function getTags(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function setApiKey(string $apiKey): self
}

/**
* @return Collection|Tag[]
* @return Collection<int, Tag>
*/
public function getTags(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function setUserProfile(?UserProfile $userProfile): self
}

/**
* @return Collection|UserAvatar[]
* @return Collection<int, UserAvatar>
*/
public function getAvatars(): Collection
{
Expand Down Expand Up @@ -102,7 +102,7 @@ public function getUserProfile(): ?UserProfile
}

/**
* @return Collection|Tag[]
* @return Collection<int, Tag>
*/
public function getTags(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function setName(string $name): self
}

/**
* @return Collection|UserAvatar[]
* @return Collection<int, UserAvatar>
*/
public function getAvatars(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getId(): ?int
}

/**
* @return Collection|Recipe[]
* @return Collection<int, Recipe>
*/
public function getRecipes(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getId(): ?int
}

/**
* @return Collection|Recipe[]
* @return Collection<int, Recipe>
*/
public function getRecipes(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getId(): ?int
}

/**
* @return Collection|Recipe[]
* @return Collection<int, Recipe>
*/
public function getRecipes(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getId(): ?int
}

/**
* @return Collection|Recipe[]
* @return Collection<int, Recipe>
*/
public function getRecipes(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getId(): ?int
}

/**
* @return Collection|Recipe[]
* @return Collection<int, Recipe>
*/
public function getRecipes(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getId(): ?int
}

/**
* @return Collection|Recipe[]
* @return Collection<int, Recipe>
*/
public function getRecipes(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getId(): ?int
}

/**
* @return Collection|UserAvatarPhoto[]
* @return Collection<int, UserAvatarPhoto>
*/
public function getAvatarPhotos(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getId(): ?int
}

/**
* @return Collection|UserAvatarPhoto[]
* @return Collection<int, UserAvatarPhoto>
*/
public function getAvatarPhotos(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getId(): ?int
}

/**
* @return Collection|UserAvatarPhoto[]
* @return Collection<int, UserAvatarPhoto>
*/
public function getAvatarPhotos(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getId(): ?int
}

/**
* @return Collection|UserAvatarPhoto[]
* @return Collection<int, UserAvatarPhoto>
*/
public function getAvatarPhotos(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getId(): ?int
}

/**
* @return Collection|UserAvatarPhoto[]
* @return Collection<int, UserAvatarPhoto>
*/
public function getAvatarPhotos(): Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getId(): ?int
}

/**
* @return Collection|UserAvatarPhoto[]
* @return Collection<int, UserAvatarPhoto>
*/
public function getAvatarPhotos(): Collection
{
Expand Down