Skip to content

Commit 62d6fbf

Browse files
author
roadiz-ci
committed
Merge branch release/v2.7.0
1 parent 1fec907 commit 62d6fbf

14 files changed

Lines changed: 57 additions & 79 deletions

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
"doctrine/orm": "~2.20.0",
2323
"api-platform/doctrine-orm": "^4.1.18",
2424
"api-platform/metadata": "^4.1.18",
25-
"roadiz/nodetype-contracts": "^3.0.0",
26-
"symfony/string": "7.3.*",
25+
"roadiz/nodetype-contracts": "^3.1.1",
26+
"symfony/string": "7.4.*",
2727
"symfony/translation-contracts": "^3.0",
28-
"symfony/http-foundation": "7.3.*",
29-
"symfony/serializer": "7.3.*",
30-
"symfony/uid": "7.3.*",
31-
"symfony/validator": "7.3.*"
28+
"symfony/http-foundation": "7.4.*",
29+
"symfony/serializer": "7.4.*",
30+
"symfony/uid": "7.4.*",
31+
"symfony/validator": "7.4.*"
3232
},
3333
"require-dev": {
3434
"doctrine/doctrine-bundle": "^2.8.1",
3535
"php-coveralls/php-coveralls": "^2.4",
36-
"phpstan/phpstan": "^1.5.3",
36+
"phpstan/phpstan": "^2.1.36",
3737
"phpstan/phpdoc-parser": "<2",
3838
"phpunit/phpunit": "^9.6"
3939
},
@@ -55,8 +55,8 @@
5555
},
5656
"extra": {
5757
"branch-alias": {
58-
"dev-master": "2.6.x-dev",
59-
"dev-develop": "2.7.x-dev"
58+
"dev-master": "2.7.x-dev",
59+
"dev-develop": "2.8.x-dev"
6060
}
6161
}
6262
}

src/Core/AbstractEntities/AbstractDateTimed.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
*
1212
* @deprecated since 2.6, use composition with DateTimedTrait instead.
1313
*/
14-
#[
15-
ORM\MappedSuperclass,
14+
#[ORM\MappedSuperclass,
1615
ORM\HasLifecycleCallbacks,
1716
ORM\Table,
1817
ORM\Index(columns: ['created_at']),
19-
ORM\Index(columns: ['updated_at']),
20-
]
18+
ORM\Index(columns: ['updated_at']),]
2119
abstract class AbstractDateTimed extends AbstractEntity implements DateTimedInterface
2220
{
2321
use DateTimedTrait;

src/Core/AbstractEntities/AbstractEntity.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
*
1212
* @deprecated since 2.6, use composition with PersistableInterface and SequentialIdTrait or UuidTrait instead.
1313
*/
14-
#[
15-
ORM\MappedSuperclass,
16-
ORM\Table
17-
]
14+
#[ORM\MappedSuperclass,
15+
ORM\Table]
1816
abstract class AbstractEntity implements PersistableInterface
1917
{
2018
use SequentialIdTrait;

src/Core/AbstractEntities/AbstractHuman.php

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
*
1717
* This class can be extended for *Users*, *Subscribers*, etc.
1818
*/
19-
#[
20-
ORM\MappedSuperclass,
19+
#[ORM\MappedSuperclass,
2120
ORM\Table,
22-
ORM\HasLifecycleCallbacks
23-
]
21+
ORM\HasLifecycleCallbacks]
2422
abstract class AbstractHuman implements DateTimedInterface, PersistableInterface
2523
{
2624
use SequentialIdTrait;
@@ -40,32 +38,24 @@ abstract class AbstractHuman implements DateTimedInterface, PersistableInterface
4038
/**
4139
* Public name (pseudonyme) that can be displayed to a public audience.
4240
*/
43-
#[
44-
ORM\Column(name: 'publicName', type: 'string', length: 250, nullable: true),
41+
#[ORM\Column(name: 'publicName', type: 'string', length: 250, nullable: true),
4542
Serializer\Groups(['user_public', 'human']),
46-
Assert\Length(max: 250)
47-
]
43+
Assert\Length(max: 250)]
4844
protected ?string $publicName = null;
4945

50-
#[
51-
ORM\Column(name: 'firstName', type: 'string', length: 250, nullable: true),
46+
#[ORM\Column(name: 'firstName', type: 'string', length: 250, nullable: true),
5247
Serializer\Groups(['user_personal', 'human']),
53-
Assert\Length(max: 250)
54-
]
48+
Assert\Length(max: 250)]
5549
protected ?string $firstName = null;
5650

57-
#[
58-
ORM\Column(name: 'lastName', type: 'string', length: 250, nullable: true),
51+
#[ORM\Column(name: 'lastName', type: 'string', length: 250, nullable: true),
5952
Serializer\Groups(['user_personal', 'human']),
60-
Assert\Length(max: 250)
61-
]
53+
Assert\Length(max: 250)]
6254
protected ?string $lastName = null;
6355

64-
#[
65-
ORM\Column(type: 'string', length: 250, nullable: true),
56+
#[ORM\Column(type: 'string', length: 250, nullable: true),
6657
Serializer\Groups(['user_personal', 'human']),
67-
Assert\Length(max: 250)
68-
]
58+
Assert\Length(max: 250)]
6959
protected ?string $company = null;
7060

7161
public function getEmail(): ?string

src/Core/AbstractEntities/AbstractPositioned.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,15 @@
1212
*
1313
* @deprecated since 2.6, use composition with PositionedTrait and PositionedInterface instead.
1414
*/
15-
#[
16-
ORM\MappedSuperclass,
15+
#[ORM\MappedSuperclass,
1716
ORM\HasLifecycleCallbacks,
1817
ORM\Table,
19-
ORM\Index(columns: ['position'])
20-
]
18+
ORM\Index(columns: ['position'])]
2119
abstract class AbstractPositioned extends AbstractEntity implements PositionedInterface
2220
{
2321
use PositionedTrait;
2422

25-
#[
26-
ORM\Column(type: 'float'),
27-
Serializer\Groups(['position']),
28-
]
23+
#[ORM\Column(type: 'float'),
24+
Serializer\Groups(['position']),]
2925
protected float $position = 0.0;
3026
}

src/Core/AbstractEntities/DateTimedInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public function getCreatedAt(): ?\DateTime;
1111
/**
1212
* @return $this
1313
*/
14-
public function setCreatedAt(?\DateTime $createdAt): self;
14+
public function setCreatedAt(?\DateTime $createdAt): static;
1515

1616
public function getUpdatedAt(): ?\DateTime;
1717

1818
/**
1919
* @return $this
2020
*/
21-
public function setUpdatedAt(?\DateTime $updatedAt): self;
21+
public function setUpdatedAt(?\DateTime $updatedAt): static;
2222
}

src/Core/AbstractEntities/DateTimedTrait.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@
99

1010
trait DateTimedTrait
1111
{
12-
#[
13-
ORM\Column(name: 'created_at', type: 'datetime', nullable: true),
14-
Serializer\Groups(['timestamps']),
15-
]
12+
#[ORM\Column(name: 'created_at', type: 'datetime', nullable: true),
13+
Serializer\Groups(['timestamps']),]
1614
protected ?\DateTime $createdAt = null;
1715

18-
#[
19-
ORM\Column(name: 'updated_at', type: 'datetime', nullable: true),
20-
Serializer\Groups(['timestamps']),
21-
]
16+
#[ORM\Column(name: 'updated_at', type: 'datetime', nullable: true),
17+
Serializer\Groups(['timestamps']),]
2218
protected ?\DateTime $updatedAt = null;
2319

2420
public function getCreatedAt(): ?\DateTime
@@ -29,7 +25,7 @@ public function getCreatedAt(): ?\DateTime
2925
/**
3026
* @return $this
3127
*/
32-
public function setCreatedAt(?\DateTime $createdAt): self
28+
public function setCreatedAt(?\DateTime $createdAt): static
3329
{
3430
$this->createdAt = $createdAt;
3531

@@ -44,7 +40,7 @@ public function getUpdatedAt(): ?\DateTime
4440
/**
4541
* @return $this
4642
*/
47-
public function setUpdatedAt(?\DateTime $updatedAt): self
43+
public function setUpdatedAt(?\DateTime $updatedAt): static
4844
{
4945
$this->updatedAt = $updatedAt;
5046

@@ -75,7 +71,7 @@ public function prePersist(): void
7571
*
7672
* @return $this
7773
*/
78-
public function resetDates(): self
74+
public function resetDates(): static
7975
{
8076
$this->setCreatedAt(new \DateTime('now'));
8177
$this->setUpdatedAt(new \DateTime('now'));

src/Core/AbstractEntities/LeafInterface.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,25 @@
66

77
use Doctrine\Common\Collections\Collection;
88

9+
/**
10+
* @template TSelf of LeafInterface
11+
*/
912
interface LeafInterface extends PositionedInterface
1013
{
14+
/**
15+
* @return Collection<int, TSelf>
16+
*/
1117
public function getChildren(): Collection;
1218

1319
/**
14-
* @param static $child
20+
* @param TSelf $child
1521
*
1622
* @return $this
1723
*/
1824
public function addChild(LeafInterface $child): static;
1925

2026
/**
21-
* @param static $child
27+
* @param TSelf $child
2228
*
2329
* @return $this
2430
*/
@@ -27,16 +33,18 @@ public function removeChild(LeafInterface $child): static;
2733
/**
2834
* Do not add static return type because of Doctrine Proxy.
2935
*
30-
* @return static|null
36+
* @return TSelf|null
3137
*/
3238
public function getParent(): ?LeafInterface;
3339

3440
/**
35-
* @return static[]
41+
* @return TSelf[]
3642
*/
3743
public function getParents(): array;
3844

3945
/**
46+
* @param TSelf|null $parent
47+
*
4048
* @return $this
4149
*/
4250
public function setParent(?LeafInterface $parent = null): static;

src/Core/AbstractEntities/LeafTrait.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,8 @@ public function removeChild(LeafInterface $child): static
6161
/*
6262
* Do not add static return type because of Doctrine Proxy.
6363
*/
64-
/**
65-
* @return static|null
66-
*/
6764
public function getParent(): ?LeafInterface
6865
{
69-
/* @phpstan-ignore-next-line */
7066
return $this->parent;
7167
}
7268

src/Core/AbstractEntities/PositionedInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public function getPosition(): float;
1414
* Set position as a float to enable increment and decrement by O.5
1515
* to insert an entity between two others.
1616
*
17+
* Do not add static return type because of Doctrine Proxy.
18+
*
1719
* @return $this
1820
*/
1921
public function setPosition(float $newPosition): PositionedInterface;

0 commit comments

Comments
 (0)