Skip to content

Commit

Permalink
fix #1272 Fix wrong PHP Symfony typehint (#1453)
Browse files Browse the repository at this point in the history
A model with an array property used to have the wrong PHP typehint in
the setter: the array item object type instead of "array"
  • Loading branch information
LudoMon authored and wing328 committed Nov 18, 2018
1 parent 2c418e1 commit 7f8ff35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@ public Map<String, Object> postProcessModels(Map<String, Object> objs) {
var.vendorExtensions.put("x-parameterType", typeHint);
}

if (var.isContainer) {
var.vendorExtensions.put("x-parameterType", getTypeHint(var.dataType + "[]"));
}

// Create a variable to display the correct data type in comments for models
var.vendorExtensions.put("x-commentType", var.dataType);
if (var.isContainer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function getPhotoUrls()
*
* @return $this
*/
public function setPhotoUrls($photoUrls)
public function setPhotoUrls(array $photoUrls)
{
$this->photoUrls = $photoUrls;

Expand All @@ -227,7 +227,7 @@ public function getTags()
*
* @return $this
*/
public function setTags(Tag $tags = null)
public function setTags(array $tags = null)
{
$this->tags = $tags;

Expand Down

0 comments on commit 7f8ff35

Please sign in to comment.