| Conditions | 4 |
| Paths | 6 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.016 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 1 | public function getClassNameFromEntityName() |
|
| 19 | { |
||
| 20 | 1 | $entities = $this->em->getConfiguration()->getMetadataDriverImpl()->getAllClassNames(); |
|
| 21 | 1 | $entityclassname = ""; |
|
| 22 | 1 | foreach ($entities as $entity) { |
|
| 23 | 1 | $parti = explode("\\", $entity); |
|
| 24 | 1 | if ($parti[count($parti) - 1] == $this->entityname) { |
|
| 25 | 1 | $entityclassname = $entity; |
|
| 26 | } |
||
| 27 | } |
||
| 28 | 1 | if (!$entityclassname) { |
|
| 29 | throw new \Exception("Non riesco a trovare l'entità '" . $this->entityname . "', è stata generata?"); |
||
| 30 | } |
||
| 31 | 1 | return $entityclassname; |
|
| 32 | } |
||
| 34 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.