Completed
Push — sf2.7 ( 18de34...b252b6 )
by Laurent
18:26
created

Group   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 3 1
A getUsers() 0 3 1
1
<?php 
2
// src/AppBundle/Entity/Group.php
3
namespace AppBundle\Entity;
4
5
use FOS\UserBundle\Model\Group as BaseGroup;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity
10
 * @ORM\Table(name="fos_group")
11
 */ 
12
class Group extends BaseGroup
13
{ 
0 ignored issues
show
Coding Style introduced by
The opening class brace should be on a newline by itself.
Loading history...
14
    /**
15
     * @ORM\Id
16
     * @ORM\Column(type="integer")
17
     * @ORM\GeneratedValue(strategy="AUTO")
18
     */
19
    protected $id;
20
    
21
    /**
22
     * @ORM\ManyToMany(targetEntity="AppBundle\Entity\User", mappedBy="groups")
23
     *
24
     */
25
    protected $users;
26
    
27
    public function __construct($name = '', $roles = array())
28
    {
29
        $this->name = $name;
30
        $this->roles = $roles;
31
    }
32
 
33
    public function __toString() {
34
        return $this->getName();
35
    }
36
 
37
    function getUsers() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
38
        return $this->users;
39
    }
40
 
41
}
42