| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function execute($entity, $arguments = []) |
||
| 45 | { |
||
| 46 | $entityExtension = $entity->getExtensionAttributes(); |
||
| 47 | $attachments = $this->attachmentRepository->getAttachmentsByProduct($entity); |
||
| 48 | |||
| 49 | if ($attachments) { |
||
|
|
|||
| 50 | $entityExtension->setProductAttachments($attachments); |
||
| 51 | } |
||
| 52 | |||
| 53 | $entity->setExtensionAttributes($entityExtension); |
||
| 54 | return $entity; |
||
| 55 | } |
||
| 56 | } |
||
| 57 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.