Skip to content

Commit

Permalink
Add return types to generated proxies (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Feb 5, 2022
1 parent 295082d commit c824e95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"require": {
"php": "^7.1 || ^8.0",
"doctrine/persistence": "^2.0"
"doctrine/persistence": "^2.0 || ^3.0"
},
"require-dev": {
"phpstan/phpstan": "^1.4.1",
Expand Down
16 changes: 8 additions & 8 deletions lib/Doctrine/Common/Proxy/ProxyGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class <proxyShortClassName> extends \<className> implements \<baseProxyInterface
/**
* Forces initialization of the proxy
*/
public function __load()
public function __load(): void
{
$this->__initializer__ && $this->__initializer__->__invoke($this, \'__load\', []);
}
Expand All @@ -171,7 +171,7 @@ public function __load()
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __isInitialized()
public function __isInitialized(): bool
{
return $this->__isInitialized__;
}
Expand All @@ -180,7 +180,7 @@ public function __isInitialized()
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setInitialized($initialized)
public function __setInitialized($initialized): void
{
$this->__isInitialized__ = $initialized;
}
Expand All @@ -189,7 +189,7 @@ public function __setInitialized($initialized)
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setInitializer(\Closure $initializer = null)
public function __setInitializer(\Closure $initializer = null): void
{
$this->__initializer__ = $initializer;
}
Expand All @@ -198,7 +198,7 @@ public function __setInitializer(\Closure $initializer = null)
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __getInitializer()
public function __getInitializer(): ?\Closure
{
return $this->__initializer__;
}
Expand All @@ -207,7 +207,7 @@ public function __getInitializer()
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific loading logic
*/
public function __setCloner(\Closure $cloner = null)
public function __setCloner(\Closure $cloner = null): void
{
$this->__cloner__ = $cloner;
}
Expand All @@ -216,7 +216,7 @@ public function __setCloner(\Closure $cloner = null)
* {@inheritDoc}
* @internal generated method: use only when explicitly handling proxy specific cloning logic
*/
public function __getCloner()
public function __getCloner(): ?\Closure
{
return $this->__cloner__;
}
Expand All @@ -227,7 +227,7 @@ public function __getCloner()
* @deprecated no longer in use - generated code now relies on internal components rather than generated public API
* @static
*/
public function __getLazyProperties()
public function __getLazyProperties(): array
{
return self::$lazyPropertiesDefaults;
}
Expand Down

0 comments on commit c824e95

Please sign in to comment.