Closed alexndr-novikov closed 5 years ago
Original entity
public function setDisplayName(string $displayName): self
{
$this->displayName = $displayName;
return $this;
}
public function setSortOrder(int $sortOrder): \stdClass
{
$this->sortOrder = $sortOrder;
return $this;
}
public function setPayout(int $payout): Profile
{
$this->payout = $payout;
return $this;
}
Generated file
/**
* {@inheritdoc}
*/
public function setDisplayName(string $displayName) : \self
{
if ($this->__resolver->__resolve() !== null) {
return $this->__resolver->__resolve()->setDisplayName($displayName);
} else {
throw new ProxyFactoryException('Promise not loaded');
}
}
/**
* {@inheritdoc}
*/
public function setSortOrder(int $sortOrder) : \stdClass
{
if ($this->__resolver->__resolve() !== null) {
return $this->__resolver->__resolve()->setSortOrder($sortOrder);
} else {
throw new ProxyFactoryException('Promise not loaded');
}
}
/**
* {@inheritdoc}
*/
public function setPayout(int $payout) : \App\Entity\Profile
{
if ($this->__resolver->__resolve() !== null) {
return $this->__resolver->__resolve()->setPayout($payout);
} else {
throw new ProxyFactoryException('Promise not loaded');
}
}
Fixed.
self
return type hint is replaced by the declared class name:
//original
public function setDisplayName(string $displayName): self
{
$this->displayName = $displayName;
return $this;
}
//before
public function setDisplayName(string $displayName) : \self
{
if ($this->__resolver->__resolve() !== null) {
return $this->__resolver->__resolve()->setDisplayName($displayName);
} else {
throw new ProxyFactoryException('Promise not loaded');
}
}
//after
public function setDisplayName(string $displayName) : \App\Entity\Profile
{
if ($this->__resolver->__resolve() !== null) {
return $this->__resolver->__resolve()->setDisplayName($displayName);
} else {
throw new ProxyFactoryException('Promise not loaded');
}
}
static
and object
return type hints now are not qualified
I have pretty common code, where I get Id in Controller action, and try to load entity:
Where profileQuestionRepository is
class ProfileQuestionRepository extends Repository
, And $question is ProfileQuestion entity with annotationfindByPK() causes Fatal error: