ProjectManager   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getCommunityProjects() 0 3 1
1
<?php
2
3
namespace App\Manager\Community;
4
5
use Doctrine\ORM\EntityManagerInterface;
6
7
use App\Entity\Community\{
8
    Community,
9
    Project
10
};
11
12
class ProjectManager
13
{
14
    protected $em;
15
    
16 1
    public function __construct(EntityManagerInterface $em)
17
    {
18 1
        $this->em = $em;
19 1
    }
20
    
21 1
    public function getCommunityProjects(Community $community): array
22
    {
23 1
        return $this->em->getRepository(Project::class)->findByCommunity($community);
0 ignored issues
show
Bug introduced by
The method findByCommunity() does not exist on Doctrine\Common\Persistence\ObjectRepository. Did you maybe mean findBy()? ( Ignorable by Annotation )

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

23
        return $this->em->getRepository(Project::class)->/** @scrutinizer ignore-call */ findByCommunity($community);

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...
24
    }
25
}