| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | * @return bool|string |
||
| 22 | */ |
||
| 23 | public static function getClassFromDocComment($comment, $includeNamespaces = true, $reflectionClass = null) |
||
| 24 | { |
||
| 25 | if (preg_match('~\@var[\s]+([A-Za-z0-9\\\\]+)~', $comment, $matches)) { |
||
| 26 | if ($includeNamespaces) { |
||
| 27 | if ($reflectionClass instanceof \ReflectionClass && !in_array($matches[1], HydratableTrait::$nonObjectTypes)) { |
||
| 28 | return ($reflectionClass->getNamespaceName()) ? sprintf('\%s\%s', $reflectionClass->getNamespaceName(), $matches[1]) : sprintf('\%s', $matches[1]); |
||
| 29 | } |
||
| 30 | return $matches[1]; |
||
| 31 | } |
||
| 37 | } |