Issues (10)

src/Entity/Customer.php (2 issues)

1
<?php
2
3
namespace Lendable\GoCardlessEnterpriseBundle\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
7
class Customer extends \Lendable\GoCardlessEnterprise\Model\Customer
8
{
9
    public function __construct()
10
    {
11
        $this->bankAccounts = new ArrayCollection();
0 ignored issues
show
Documentation Bug introduced by
It seems like new Doctrine\Common\Collections\ArrayCollection() of type Doctrine\Common\Collections\ArrayCollection is incompatible with the declared type array of property $bankAccounts.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
12
    }
13
14
    /**
15
     * @param CustomerBankAccount $bankAccount
16
     */
17
    public function addBankAccount(CustomerBankAccount $bankAccount)
18
    {
19
        $this->bankAccounts[] = $bankAccount;
20
        $bankAccount->setCustomer($this);
21
    }
22
23
    /**
24
     * @param CustomerBankAccount $bankAccount
25
     */
26
    public function removeBankAccount(CustomerBankAccount $bankAccount)
27
    {
28
        $this->bankAccounts->removeElement($bankAccount);
29
    }
30
31
    public function fromArray($data)
32
    {
33
        parent::fromArray($data);
34
        $this->setCreatedAt(new \DateTime($this->getCreatedAt()));
0 ignored issues
show
new DateTime($this->getCreatedAt()) of type DateTime is incompatible with the type string expected by parameter $createdAt of Lendable\GoCardlessEnter...l\Model::setCreatedAt(). ( Ignorable by Annotation )

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

34
        $this->setCreatedAt(/** @scrutinizer ignore-type */ new \DateTime($this->getCreatedAt()));
Loading history...
35
    }
36
}
37