| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 12 | 
| Code Lines | 7 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 7 | 
| CRAP Score | 1 | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 18 | 8 | final public function generate($fqcn): ProxyInterface  | 
            |
| 19 |     { | 
            ||
| 20 | 8 | $object = $this->mockingStrategy->build($fqcn);  | 
            |
| 21 | 8 | $codeWillBeEvaluated = ProxyClassGenerator::generateCode(get_class($object));  | 
            |
| 22 | |||
| 23 | /** @var ProxyInterface|ProxyTrait $proxy */  | 
            ||
| 24 | 8 | $proxy = eval($codeWillBeEvaluated);  | 
            |
| 25 | 8 | $proxy->_moka_setObject($object);  | 
            |
| 
                                                                                                    
                        
                         | 
                |||
| 26 | 8 | $proxy->_moka_setMockingStrategy($this->mockingStrategy);  | 
            |
| 27 | |||
| 28 | 8 | return $proxy;  | 
            |
| 29 | }  | 
            ||
| 30 | }  | 
            ||
| 31 | 
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: