Skip to content

Commit d6d06ad

Browse files
committed
PHP8
1 parent e05fded commit d6d06ad

File tree

3 files changed

+19
-99
lines changed

3 files changed

+19
-99
lines changed

Entity/Mixin/UserStats.php

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,64 +10,44 @@
1010

1111
trait UserStats
1212
{
13-
/**
14-
* @ORM\Column(type="datetime", nullable=true)
15-
*/
13+
#[ORM\Column(type: "datetime", nullable: true)]
1614
private $lastConnexion;
1715

18-
/**
19-
* @ORM\Column(type="datetime", nullable=true)
20-
*/
16+
#[ORM\Column(type: "datetime", nullable: true)]
2117
private $lastVisited;
2218

23-
/**
24-
* @ORM\Column(type="bigint")
25-
*/
19+
#[ORM\Column(type: "bigint")]
2620
private $nbPageViews = 0;
2721

28-
/**
29-
* @ORM\OneToMany(targetEntity="FluffyFactory\Bundle\UserStatsBundle\Entity\UserStatsLines", mappedBy="user", cascade={"persist", "remove"})
30-
*/
22+
#[ORM\OneToMany(targetEntity: UserStatsLines::class, mappedBy: "user", cascade: ["persist", "remove"])]
3123
private $userLines;
3224

3325
public function __construct() {
3426
$this->userLines = new ArrayCollection();
3527
}
3628

37-
/**
38-
* @return mixed
39-
*/
4029
public function getLastConnexion()
4130
{
4231
return $this->lastConnexion;
4332
}
4433

45-
/**
46-
* @param mixed $lastConnexion
47-
*/
4834
public function setLastConnexion($lastConnexion): void
4935
{
5036
$this->lastConnexion = $lastConnexion;
5137
}
5238

53-
/**
54-
* @return mixed
55-
*/
5639
public function getLastVisited()
5740
{
5841
return $this->lastVisited;
5942
}
6043

61-
/**
62-
* @param mixed $lastVisited
63-
*/
6444
public function setLastVisited($lastVisited): void
6545
{
6646
$this->lastVisited = $lastVisited;
6747
}
6848

6949
/**
70-
* @return Collection|User[]
50+
* @return Collection
7151
*/
7252
public function getUserLines(): Collection
7353
{
@@ -97,17 +77,11 @@ public function removeUserLines(UserStatsLines $userLines): self
9777
return $this;
9878
}
9979

100-
/**
101-
* @return int
102-
*/
10380
public function getNbPageViews(): int
10481
{
10582
return $this->nbPageViews;
10683
}
10784

108-
/**
109-
* @param int $nbPageViews
110-
*/
11185
public function setNbPageViews(int $nbPageViews): void
11286
{
11387
$this->nbPageViews = $nbPageViews;

Entity/UserStatsLines.php

Lines changed: 13 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,158 +3,104 @@
33
namespace FluffyFactory\Bundle\UserStatsBundle\Entity;
44

55
use DateTime;
6+
use App\Entity\User;
67
use Doctrine\ORM\Mapping as ORM;
78
use Doctrine\ORM\Mapping\ManyToOne;
89
use Symfony\Component\Validator\Constraints as Assert;
910

10-
/**
11-
* @ORM\Entity(repositoryClass="FluffyFactory\Bundle\UserStatsBundle\Repository\UserStatsLinesRepository")
12-
*/
11+
#[ORM\Entity(repositoryClass: "FluffyFactory\Bundle\UserStatsBundle\Repository\UserStatsLinesRepository")]
1312
class UserStatsLines
1413
{
15-
/**
16-
* @ORM\Id()
17-
* @ORM\GeneratedValue()
18-
* @ORM\Column(type="integer")
19-
*/
14+
#[ORM\Id]
15+
#[ORM\GeneratedValue]
16+
#[ORM\Column(type: "integer")]
2017
private $id;
2118

22-
/**
23-
* @ManyToOne(targetEntity="App\Entity\User", inversedBy="userLines")
24-
* @ORM\JoinColumn(nullable=false)
25-
*/
19+
#[ManyToOne(targetEntity: User::class, inversedBy: "userLines")]
20+
#[ORM\JoinColumn(nullable: false)]
2621
private $user;
2722

28-
/**
29-
* @ORM\Column(type="datetime")
30-
* @Assert\NotBlank()
31-
*/
23+
#[ORM\Column(type: "datetime")]
24+
#[Assert\NotBlank]
3225
private $createdAt;
3326

34-
/**
35-
* @ORM\Column(type="text")
36-
*/
27+
#[ORM\Column(type: "text")]
3728
private $url;
3829

39-
/**
40-
* @ORM\Column(type="text")
41-
*/
30+
#[ORM\Column(type: "text")]
4231
private $route;
4332

44-
/**
45-
* @ORM\Column(type="string", nullable=true)
46-
*/
33+
#[ORM\Column(type: "string", nullable: true)]
4734
private $sessionId;
4835

49-
/**
50-
* @ORM\Column(type="string")
51-
*/
36+
#[ORM\Column(type: "string")]
5237
private $browser;
5338

5439
public function __construct()
5540
{
5641
$this->createdAt = new DateTime();
5742
}
5843

59-
/**
60-
* @return mixed
61-
*/
6244
public function getUser()
6345
{
6446
return $this->user;
6547
}
6648

67-
/**
68-
* @param mixed $user
69-
*/
7049
public function setUser($user): void
7150
{
7251
$this->user = $user;
7352
}
7453

75-
/**
76-
* @return mixed
77-
*/
7854
public function getId()
7955
{
8056
return $this->id;
8157
}
8258

83-
/**
84-
* @return mixed
85-
*/
8659
public function getCreatedAt()
8760
{
8861
return $this->createdAt;
8962
}
9063

91-
/**
92-
* @param mixed $createdAt
93-
*/
9464
public function setCreatedAt($createdAt): void
9565
{
9666
$this->createdAt = $createdAt;
9767
}
9868

99-
/**
100-
* @return mixed
101-
*/
10269
public function getUrl()
10370
{
10471
return $this->url;
10572
}
10673

107-
/**
108-
* @param mixed $url
109-
*/
11074
public function setUrl($url): void
11175
{
11276
$this->url = $url;
11377
}
11478

115-
/**
116-
* @return mixed
117-
*/
11879
public function getRoute()
11980
{
12081
return $this->route;
12182
}
12283

123-
/**
124-
* @param mixed $route
125-
*/
12684
public function setRoute($route): void
12785
{
12886
$this->route = $route;
12987
}
13088

131-
/**
132-
* @return string|null
133-
*/
13489
public function getSessionId(): ?string
13590
{
13691
return $this->sessionId;
13792
}
13893

139-
/**
140-
* @param string|null $sessionId
141-
*/
14294
public function setSessionId(?string $sessionId): void
14395
{
14496
$this->sessionId = $sessionId;
14597
}
14698

147-
/**
148-
* @return mixed
149-
*/
15099
public function getBrowser()
151100
{
152101
return $this->browser;
153102
}
154103

155-
/**
156-
* @param mixed $browser
157-
*/
158104
public function setBrowser($browser): void
159105
{
160106
$this->browser = $browser;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
],
1919
"require": {
20-
"php": ">=7.2.0"
20+
"php": ">=8.0"
2121
},
2222
"autoload": {
2323
"psr-4": {

0 commit comments

Comments
 (0)