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