User::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Copyright (c) 2016 Francois-Xavier Soubirou.
5
 *
6
 * This file is part of eco4.
7
 *
8
 * eco4 is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation, either version 3 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * eco4 is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with eco4. If not, see <http://www.gnu.org/licenses/>.
20
 */
21
declare(strict_types=1);
22
23
namespace AppBundle\Entity;
24
25
use Doctrine\ORM\Mapping as ORM;
26
use FOS\UserBundle\Model\User as BaseUser;
27
28
/**
29
 * User entity class.
30
 *
31
 * @category  Eco4 App
32
 *
33
 * @author    Francois-Xavier Soubirou <[email protected]>
34
 * @copyright 2016 Francois-Xavier Soubirou
35
 * @license   http://www.gnu.org/licenses/   GPLv3
36
 *
37
 * @link      https://www.eco4.io
38
 *
39
 * @ORM\Table(name="eco4_user")
40
 * @ORM\Entity
41
 */
42
class User extends BaseUser
43
{
44
    /**
45
     * @var int
46
     *
47
     * @ORM\Id
48
     * @ORM\Column(type="integer")
49
     * @ORM\GeneratedValue(strategy="AUTO")
50
     */
51
    protected $id;
52
53
    /**
54
     * @ORM\OneToOne(targetEntity="AppBundle\Entity\Mine", cascade={"remove", "persist"})
55
     */
56
    protected $mine;
57
58
    /**
59
     * Constructor.
60
     */
61
    public function __construct()
62
    {
63
        parent::__construct();
64
// TODO
0 ignored issues
show
Unused Code Comprehensibility introduced by
38% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
65
//         $this->mine = new Mine();
66
    }
67
68
    /**
69
     * Set mine.
70
     *
71
     * @param Mine $mine
72
     *
73
     * @return User
74
     */
75
    public function setMine(Mine $mine): User
76
    {
77
        $this->mine = $mine;
78
79
        return $this;
80
    }
81
82
    /**
83
     * Get mine of user.
84
     *
85
     * @return Mine
86
     */
87
    public function getMine(): Mine
88
    {
89
        return $this->mine;
90
    }
91
}
92