forked from loafle/openapi-generator-original
[php-symfony] Fix return type in model setters. (#6085)
* Fix return type in model setters.
Previously return type was same, as method arguments. It`s wrong, and cause errors like
"Return value of Foo::setSuccess() must be of the type bool, object returned"
We cant use self and current {{classname}} as return type, because that can break class inheritance. So, better remove type hint on setters, until PHP-devs dont make realization for return static
* Add return self type hint for setters
* Revert "Add return self type hint for setters"
This reverts commit 07dd9715
This commit is contained in:
@@ -197,7 +197,7 @@ class Order
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShipDate(\DateTime $shipDate = null): ?\DateTime
|
||||
public function setShipDate(\DateTime $shipDate = null)
|
||||
{
|
||||
$this->shipDate = $shipDate;
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ class Pet
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCategory(Category $category = null): ?Category
|
||||
public function setCategory(Category $category = null)
|
||||
{
|
||||
$this->category = $category;
|
||||
|
||||
@@ -203,7 +203,7 @@ class Pet
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhotoUrls(array $photoUrls): array
|
||||
public function setPhotoUrls(array $photoUrls)
|
||||
{
|
||||
$this->photoUrls = $photoUrls;
|
||||
|
||||
@@ -227,7 +227,7 @@ class Pet
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTags(array $tags = null): ?array
|
||||
public function setTags(array $tags = null)
|
||||
{
|
||||
$this->tags = $tags;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user