| Conditions | 5 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5.2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 56 | public function loadClassMetadata(LoadClassMetadataEventArgs $args) |
|
| 22 | { |
||
| 23 | 56 | $classMetadata = $args->getClassMetadata(); |
|
| 24 | |||
| 25 | 56 | if (false !== strpos($classMetadata->namespace, 'Fi\CoreBundle')) { |
|
| 26 | 56 | $classMetadata->setPrimaryTable(array('name' => $this->prefix.$classMetadata->getTableName())); |
|
| 27 | |||
| 28 | 56 | foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { |
|
| 29 | 54 | if ($mapping['type'] == \Doctrine\ORM\Mapping\ClassMetadataInfo::MANY_TO_MANY |
|
| 30 | 54 | && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name']) |
|
| 31 | 54 | ) { |
|
| 32 | $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name']; |
||
|
|
|||
| 33 | $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix.$mappedTableName; |
||
| 34 | } |
||
| 39 |
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.