| Conditions | 4 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 7.1753 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | 2 | private function getRealClassName(string $className): string |
|
| 37 | { |
||
| 38 | // __CG__: Doctrine Common Marker for Proxy (ODM < 2.0 and ORM < 3.0) |
||
| 39 | // __PM__: Ocramius Proxy Manager (ODM >= 2.0) |
||
| 40 | 2 | $positionCg = strrpos($className, '\\__CG__\\'); |
|
| 41 | 2 | $positionPm = strrpos($className, '\\__PM__\\'); |
|
| 42 | |||
| 43 | 2 | if (false === $positionCg && false === $positionPm) { |
|
| 44 | 2 | return $className; |
|
| 45 | } |
||
| 46 | |||
| 47 | if (false !== $positionCg) { |
||
| 48 | return substr($className, $positionCg + 8); |
||
| 49 | } |
||
| 50 | |||
| 51 | $className = ltrim($className, '\\'); |
||
| 52 | |||
| 53 | return substr( |
||
| 54 | $className, |
||
| 55 | 8 + $positionPm, |
||
| 56 | strrpos($className, '\\') - ($positionPm + 8) |
||
| 57 | ); |
||
| 60 |