GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( acc64b...81648c )
by Andreas
03:48
created

CustomerCollection::_initSelect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 11
rs 10
c 1
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
6
namespace CommerceLeague\ActiveCampaign\Model\ResourceModel\Magento;
7
8
use CommerceLeague\ActiveCampaign\Setup\SchemaInterface;
9
use Magento\Customer\Model\ResourceModel\Customer\Collection as ExtendCustomerCollection;
10
11
/**
12
 * Class CustomerCollection
13
 * @codeCoverageIgnore
14
 */
15
class CustomerCollection extends ExtendCustomerCollection
16
{
17
    /**
18
     * @inheritDoc
19
     */
20
    protected function _initSelect()
21
    {
22
        parent::_initSelect();
23
24
        $this->getSelect()->joinLeft(
25
            ['acc' => $this->_resource->getTableName(SchemaInterface::CUSTOMER_TABLE)],
0 ignored issues
show
Unused Code introduced by
The call to Magento\Framework\DB\Select::joinLeft() has too many arguments starting with array('acc' => $this->_r...rface::CUSTOMER_TABLE)). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
        $this->getSelect()->/** @scrutinizer ignore-call */ joinLeft(

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.

Loading history...
26
            'acc.magento_customer_id = e.entity_id',
27
            ['acc.activecampaign_id']
28
        );
29
30
        return $this;
31
    }
32
33
    /**
34
     * @param string $email
35
     * @return CustomerCollection
36
     */
37
    public function addEmailFilter(string $email): self
38
    {
39
        $this->getSelect()->where('e.email = ?', $email);
40
        return $this;
41
    }
42
43
    /**
44
     * @return CustomerCollection
45
     */
46
    public function addOmittedFilter(): self
47
    {
48
        $this->getSelect()->where('acc.activecampaign_id IS NULL');
49
        return $this;
50
    }
51
}
52