| Conditions | 1 |
| Paths | 1 |
| Total Lines | 7 |
| Code Lines | 4 |
| Lines | 7 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | View Code Duplication | public function testEntityId() |
|
| 42 | { |
||
| 43 | $entity = $this->mock(); |
||
| 44 | /** @noinspection PhpUnhandledExceptionInspection */ |
||
| 45 | self::getProperty(get_class($entity), 'id')->setValue($entity, 'test-id'); |
||
| 46 | self::assertEquals('test-id', $entity->getEntityId()); |
||
| 47 | } |
||
| 48 | //</editor-fold desc="Public Methods"> |
||
| 59 | } |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: