Open vermi0ffh opened 5 years ago
Actual ProxyFactory don't works well with PHP7 type hint et return type.
Examples :
public function getId(): ?string { return $this->id; }
Old generator gives : public function getId() { $this->__load(); return parent::getId(); }
public function getId() { $this->__load(); return parent::getId(); }
This lead to a compilation error because getId() is not compatible with he original getId() (no return type).
With this patch, the result is : public function getId(): ?string { $this->__load(); return parent::getId(); }
public function getId(): ?string { $this->__load(); return parent::getId(); }
No more compilation error. It's backward compatible with the existing code and PHP < 7 (not tested).
Any plan to merge this pull request one day ?
Actual ProxyFactory don't works well with PHP7 type hint et return type.
Examples :
public function getId(): ?string { return $this->id; }
Old generator gives :
public function getId() { $this->__load(); return parent::getId(); }
This lead to a compilation error because getId() is not compatible with he original getId() (no return type).
With this patch, the result is :
public function getId(): ?string { $this->__load(); return parent::getId(); }
No more compilation error. It's backward compatible with the existing code and PHP < 7 (not tested).