UpdateCompany::update()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the G.L.S.R. Apps package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Company\Infrastructure\Storage\Company;
15
16
use Company\Domain\Model\Company as CompanyModel;
17
use Company\Infrastructure\Doctrine\Repository\CompanyRepository;
18
19
class UpdateCompany
20
{
21
    private CompanyRepository $companyRepository;
22
    private ReadCompany $readCompany;
23
24
    public function __construct(CompanyRepository $companyRepository, ReadCompany $readCompany)
25
    {
26
        $this->companyRepository = $companyRepository;
27
        $this->readCompany = $readCompany;
28
    }
29
30
    public function update(CompanyModel $companyModel): void
31
    {
32
        $companyEntity = $this->readCompany->findOneByUuid($companyModel->uuid());
33
34
        $companyEntity->update($companyModel);
0 ignored issues
show
Bug introduced by
The method update() does not exist on Company\Domain\Model\Company. ( Ignorable by Annotation )

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

34
        $companyEntity->/** @scrutinizer ignore-call */ 
35
                        update($companyModel);

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...
35
36
        $this->companyRepository->flush();
37
    }
38
}
39