| Total Complexity | 4 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class CustomerCollection extends ExtendCustomerCollection |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @inheritDoc |
||
| 19 | */ |
||
| 20 | protected function _initSelect() |
||
| 21 | { |
||
| 22 | parent::_initSelect(); |
||
| 23 | |||
| 24 | $this->getSelect()->joinLeft( |
||
| 25 | ['ac_contact' => $this->_resource->getTableName(SchemaInterface::CONTACT_TABLE)], |
||
|
|
|||
| 26 | 'ac_contact.email = e.email', |
||
| 27 | ['ac_contact.activecampaign_id'] |
||
| 28 | ); |
||
| 29 | |||
| 30 | $this->getSelect()->joinLeft( |
||
| 31 | ['ac_customer' => $this->_resource->getTableName(SchemaInterface::CUSTOMER_TABLE)], |
||
| 32 | 'ac_customer.magento_customer_id = e.entity_id', |
||
| 33 | ['ac_customer.activecampaign_id'] |
||
| 34 | ); |
||
| 35 | |||
| 36 | return $this; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param string $email |
||
| 41 | * @return CustomerCollection |
||
| 42 | */ |
||
| 43 | public function addEmailFilter(string $email): self |
||
| 44 | { |
||
| 45 | $this->getSelect()->where('e.email = ?', $email); |
||
| 46 | return $this; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return CustomerCollection |
||
| 51 | */ |
||
| 52 | public function addContactOmittedFilter(): self |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return CustomerCollection |
||
| 60 | */ |
||
| 61 | public function addCustomerOmittedFilter(): self |
||
| 67 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.