@@ -32,9 +32,9 @@ |
||
32 | 32 | |
33 | 33 | /** |
34 | 34 | * RepositoryDefinition constructor. |
35 | - * @param $id |
|
36 | - * @param $refClass |
|
37 | - * @param $entityClass |
|
35 | + * @param string $id |
|
36 | + * @param \ReflectionClass $refClass |
|
37 | + * @param string $entityClass |
|
38 | 38 | */ |
39 | 39 | public function __construct($id, $refClass, $entityClass) |
40 | 40 | { |
@@ -58,9 +58,9 @@ |
||
58 | 58 | |
59 | 59 | // 同じパッケージのEntityがあれば返す |
60 | 60 | if (count($partsOfFqcn) > 2) { |
61 | - $parentNamespace = implode('\\', array_slice($partsOfFqcn, 0, count($partsOfFqcn)-2)); |
|
62 | - $entityName = preg_replace('/(.*)Repository/', '$1', $partsOfFqcn[count($partsOfFqcn) -1]); |
|
63 | - $result = $parentNamespace . '\\Entity\\' . $entityName; |
|
61 | + $parentNamespace = implode('\\', array_slice($partsOfFqcn, 0, count($partsOfFqcn) - 2)); |
|
62 | + $entityName = preg_replace('/(.*)Repository/', '$1', $partsOfFqcn[count($partsOfFqcn) - 1]); |
|
63 | + $result = $parentNamespace.'\\Entity\\'.$entityName; |
|
64 | 64 | if (class_exists($result)) { |
65 | 65 | return $result; |
66 | 66 | } |