Skip to content

Commit 1720ddd

Browse files
authored
Merge pull request #203 from SpazzMarticus/fix-return-types-for-doctrine-proxy
Fix return types for Doctrine\Persistence\Proxy implementations
2 parents 024473a + 3424b4d commit 1720ddd

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

fixtures/f013/A.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace DeepCopy\f013;
44

5+
use BadMethodCallException;
56
use Doctrine\Persistence\Proxy;
67

78
class A implements Proxy
@@ -11,14 +12,15 @@ class A implements Proxy
1112
/**
1213
* @inheritdoc
1314
*/
14-
public function __load()
15+
public function __load(): void
1516
{
1617
}
1718

1819
/**
1920
* @inheritdoc
2021
*/
21-
public function __isInitialized()
22+
public function __isInitialized(): bool
2223
{
24+
throw new BadMethodCallException();
2325
}
2426
}

fixtures/f013/B.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace DeepCopy\f013;
44

5+
use BadMethodCallException;
56
use Doctrine\Persistence\Proxy;
67

78
class B implements Proxy
@@ -11,15 +12,16 @@ class B implements Proxy
1112
/**
1213
* @inheritdoc
1314
*/
14-
public function __load()
15+
public function __load(): void
1516
{
1617
}
1718

1819
/**
1920
* @inheritdoc
2021
*/
21-
public function __isInitialized()
22+
public function __isInitialized(): bool
2223
{
24+
throw new BadMethodCallException();
2325
}
2426

2527
public function getFoo()

tests/DeepCopyTest/Matcher/Doctrine/DoctrineProxyMatcherTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ class FooProxy implements Proxy
3939
/**
4040
* @inheritdoc
4141
*/
42-
public function __load()
42+
public function __load(): void
4343
{
4444
throw new BadMethodCallException();
4545
}
4646

4747
/**
4848
* @inheritdoc
4949
*/
50-
public function __isInitialized()
50+
public function __isInitialized(): bool
5151
{
5252
throw new BadMethodCallException();
5353
}

0 commit comments

Comments
 (0)