Session   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
eloc 17
c 1
b 0
f 0
dl 0
loc 69
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setSessTime() 0 5 1
A getSessTime() 0 3 1
A getSessData() 0 3 1
A getSessId() 0 3 1
A setSessData() 0 5 1
A setSessId() 0 5 1
A setSessLifetime() 0 5 1
A getSessLifetime() 0 3 1
1
<?php
2
3
namespace App\Entity;
4
5
use App\Repository\SessionRepository;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity(repositoryClass=SessionRepository::class)
10
 * @ORM\Table(name="sessions", options={"collate": "utf8mb4_bin"})
11
 */
12
class Session
13
{
14
    /**
15
     * @ORM\Id
16
     * @ORM\Column(type="binary")
17
     */
18
    private $sess_id;
19
20
    /**
21
     * @ORM\Column(type="blob")
22
     */
23
    private $sess_data;
24
25
    /**
26
     * @ORM\Column(type="bigint")
27
     */
28
    private $sess_lifetime;
29
30
    /**
31
     * @ORM\Column(type="integer", options={"unsigned": true})
32
     */
33
    private $sess_time;
34
35
    public function getSessId()
36
    {
37
        return $this->sess_id;
38
    }
39
40
    public function setSessId($sess_id): self
41
    {
42
        $this->sess_id = $sess_id;
43
44
        return $this;
45
    }
46
47
    public function getSessData()
48
    {
49
        return $this->sess_data;
50
    }
51
52
    public function setSessData($sess_data): self
53
    {
54
        $this->sess_data = $sess_data;
55
56
        return $this;
57
    }
58
59
    public function getSessLifetime(): ?string
60
    {
61
        return $this->sess_lifetime;
62
    }
63
64
    public function setSessLifetime(string $sess_lifetime): self
65
    {
66
        $this->sess_lifetime = $sess_lifetime;
0 ignored issues
show
Documentation Bug introduced by
The property $sess_lifetime was declared of type integer, but $sess_lifetime is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
67
68
        return $this;
69
    }
70
71
    public function getSessTime(): ?int
72
    {
73
        return $this->sess_time;
74
    }
75
76
    public function setSessTime(int $sess_time): self
77
    {
78
        $this->sess_time = $sess_time;
79
80
        return $this;
81
    }
82
}
83