Issues (3627)

Integration/Pipedrive/Import/OwnerImport.php (1 issue)

1
<?php
2
3
namespace MauticPlugin\MauticCrmBundle\Integration\Pipedrive\Import;
4
5
use MauticPlugin\MauticCrmBundle\Entity\PipedriveOwner;
6
7
class OwnerImport extends AbstractImport
8
{
9
    /**
10
     * @return bool
11
     *
12
     * @throws \Doctrine\ORM\OptimisticLockException
13
     */
14
    public function create(array $data = [])
15
    {
16
        $pipedriveOwner = $this->em->getRepository(PipedriveOwner::class)->findOneByOwnerId($data['id']);
0 ignored issues
show
The method findOneByOwnerId() does not exist on Doctrine\Common\Persistence\ObjectRepository. Did you maybe mean findOneBy()? ( Ignorable by Annotation )

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

16
        $pipedriveOwner = $this->em->getRepository(PipedriveOwner::class)->/** @scrutinizer ignore-call */ findOneByOwnerId($data['id']);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
17
18
        if (!$pipedriveOwner) {
19
            $pipedriveOwner = new PipedriveOwner();
20
        }
21
22
        $pipedriveOwner->setEmail($data['email']);
23
        $pipedriveOwner->setOwnerId($data['id']);
24
25
        $this->em->persist($pipedriveOwner);
26
        $this->em->flush();
27
28
        return true;
29
    }
30
}
31