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.
Completed
Push — master ( 63b552...a4bd13 )
by Andreas
03:35
created

Collection::addCustomerOmittedFilter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
6
namespace CommerceLeague\ActiveCampaign\Model\ResourceModel\Customer;
7
8
use CommerceLeague\ActiveCampaign\Model\ResourceModel\Magento\CustomerCollection;
0 ignored issues
show
Bug introduced by
The type CommerceLeague\ActiveCam...ento\CustomerCollection was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use CommerceLeague\ActiveCampaign\Setup\SchemaInterface;
10
use Magento\Customer\Model\ResourceModel\Customer\Collection as ExtendCustomerCollection;
11
12
/**
13
 * Class Collection
14
 * @codeCoverageIgnore
15
 */
16
class Collection extends ExtendCustomerCollection
17
{
18
    /**
19
     * @inheritDoc
20
     */
21
    protected function _initSelect()
22
    {
23
        parent::_initSelect();
24
25
        $this->getSelect()->joinLeft(
26
            ['ac_contact' => $this->_resource->getTableName(SchemaInterface::CONTACT_TABLE)],
0 ignored issues
show
Unused Code introduced by
The call to Magento\Framework\DB\Select::joinLeft() has too many arguments starting with array('ac_contact' => $t...erface::CONTACT_TABLE)). ( Ignorable by Annotation )

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

26
        $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...
27
            'ac_contact.email = e.email',
28
            ['ac_contact.activecampaign_id']
29
        );
30
31
        $this->getSelect()->joinLeft(
32
            ['ac_customer' => $this->_resource->getTableName(SchemaInterface::CUSTOMER_TABLE)],
33
            'ac_customer.magento_customer_id = e.entity_id',
34
            ['ac_customer.activecampaign_id']
35
        );
36
37
        return $this;
38
    }
39
40
    /**
41
     * @param string $email
42
     * @return Collection
43
     */
44
    public function addEmailFilter(string $email): self
45
    {
46
        $this->getSelect()->where('e.email = ?', $email);
47
        return $this;
48
    }
49
50
    /**
51
     * @return Collection
52
     */
53
    public function addContactOmittedFilter(): self
54
    {
55
        $this->getSelect()->where('ac_contact.activecampaign_id IS NULL');
56
        return $this;
57
    }
58
59
    /**
60
     * @return Collection
61
     */
62
    public function addCustomerOmittedFilter(): self
63
    {
64
        $this->getSelect()->where('ac_customer.activecampaign_id IS NULL');
65
        return $this;
66
    }
67
}
68
69