Completed
Pull Request — dev (#6)
by Arnaud
07:28 queued 04:28
created

GenericRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
3
namespace LAG\AdminBundle\Repository;
4
5
use Doctrine\Common\Persistence\ObjectManager;
6
use Doctrine\Common\Persistence\ObjectRepository;
7
use LAG\DoctrineRepositoryBundle\Repository\DoctrineRepository;
8
9
/**
10
 * Generic implementation of DoctrineRepository abstract class
11
 */
12
class GenericRepository extends DoctrineRepository
13
{
14
    /**
15
     * GenericRepository constructor.
16
     *
17
     * @param ObjectManager $objectManager
18
     * @param ObjectRepository $repository
19
     * @param $entityClassName
20
     */
21
    public function __construct(ObjectManager $objectManager, ObjectRepository $repository, $entityClassName)
22
    {
23
        $this->objectManager = $objectManager;
0 ignored issues
show
Bug introduced by
The property objectManager does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
24
        $this->repository = $repository;
0 ignored issues
show
Bug introduced by
The property repository does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
25
        $this->entityClassName = $entityClassName;
0 ignored issues
show
Bug introduced by
The property entityClassName does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
26
    }
27
}
28