Skip to content

Commit c824e95

Browse files
authored
Add return types to generated proxies (#956)
1 parent 295082d commit c824e95

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": "^7.1 || ^8.0",
22-
"doctrine/persistence": "^2.0"
22+
"doctrine/persistence": "^2.0 || ^3.0"
2323
},
2424
"require-dev": {
2525
"phpstan/phpstan": "^1.4.1",

lib/Doctrine/Common/Proxy/ProxyGenerator.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class <proxyShortClassName> extends \<className> implements \<baseProxyInterface
162162
/**
163163
* Forces initialization of the proxy
164164
*/
165-
public function __load()
165+
public function __load(): void
166166
{
167167
$this->__initializer__ && $this->__initializer__->__invoke($this, \'__load\', []);
168168
}
@@ -171,7 +171,7 @@ public function __load()
171171
* {@inheritDoc}
172172
* @internal generated method: use only when explicitly handling proxy specific loading logic
173173
*/
174-
public function __isInitialized()
174+
public function __isInitialized(): bool
175175
{
176176
return $this->__isInitialized__;
177177
}
@@ -180,7 +180,7 @@ public function __isInitialized()
180180
* {@inheritDoc}
181181
* @internal generated method: use only when explicitly handling proxy specific loading logic
182182
*/
183-
public function __setInitialized($initialized)
183+
public function __setInitialized($initialized): void
184184
{
185185
$this->__isInitialized__ = $initialized;
186186
}
@@ -189,7 +189,7 @@ public function __setInitialized($initialized)
189189
* {@inheritDoc}
190190
* @internal generated method: use only when explicitly handling proxy specific loading logic
191191
*/
192-
public function __setInitializer(\Closure $initializer = null)
192+
public function __setInitializer(\Closure $initializer = null): void
193193
{
194194
$this->__initializer__ = $initializer;
195195
}
@@ -198,7 +198,7 @@ public function __setInitializer(\Closure $initializer = null)
198198
* {@inheritDoc}
199199
* @internal generated method: use only when explicitly handling proxy specific loading logic
200200
*/
201-
public function __getInitializer()
201+
public function __getInitializer(): ?\Closure
202202
{
203203
return $this->__initializer__;
204204
}
@@ -207,7 +207,7 @@ public function __getInitializer()
207207
* {@inheritDoc}
208208
* @internal generated method: use only when explicitly handling proxy specific loading logic
209209
*/
210-
public function __setCloner(\Closure $cloner = null)
210+
public function __setCloner(\Closure $cloner = null): void
211211
{
212212
$this->__cloner__ = $cloner;
213213
}
@@ -216,7 +216,7 @@ public function __setCloner(\Closure $cloner = null)
216216
* {@inheritDoc}
217217
* @internal generated method: use only when explicitly handling proxy specific cloning logic
218218
*/
219-
public function __getCloner()
219+
public function __getCloner(): ?\Closure
220220
{
221221
return $this->__cloner__;
222222
}
@@ -227,7 +227,7 @@ public function __getCloner()
227227
* @deprecated no longer in use - generated code now relies on internal components rather than generated public API
228228
* @static
229229
*/
230-
public function __getLazyProperties()
230+
public function __getLazyProperties(): array
231231
{
232232
return self::$lazyPropertiesDefaults;
233233
}

0 commit comments

Comments
 (0)