Skip to content

Commit 748324c

Browse files
author
roadiz-ci
committed
Merge branch hotfix/v2.6.8
1 parent b0caa36 commit 748324c

21 files changed

Lines changed: 254 additions & 945 deletions

.github/workflows/run-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
php-version: ['8.2', '8.3']
22+
php-version: ['8.3', '8.4']
2323
steps:
2424
- uses: shivammathur/setup-php@v2
2525
with:

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright © 2024 Ambroise Maupate
3+
Copyright © 2025 Ambroise Maupate
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

composer.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,24 @@
1818
}
1919
],
2020
"require": {
21-
"php": ">=8.2",
21+
"php": ">=8.3",
2222
"doctrine/orm": "~2.20.0",
23-
"jms/serializer": "^3.9.0",
24-
"roadiz/nodetype-contracts": "~1.1.2",
25-
"symfony/string": "6.4.*",
23+
"api-platform/doctrine-orm": "^4.1.18",
24+
"api-platform/metadata": "^4.1.18",
25+
"roadiz/nodetype-contracts": "^3.0.0",
26+
"symfony/string": "7.3.*",
2627
"symfony/translation-contracts": "^3.0",
27-
"symfony/http-foundation": "6.4.*",
28-
"symfony/serializer": "6.4.*",
29-
"symfony/validator": "6.4.*"
28+
"symfony/http-foundation": "7.3.*",
29+
"symfony/serializer": "7.3.*",
30+
"symfony/uid": "7.3.*",
31+
"symfony/validator": "7.3.*"
3032
},
3133
"require-dev": {
3234
"doctrine/doctrine-bundle": "^2.8.1",
3335
"php-coveralls/php-coveralls": "^2.4",
3436
"phpstan/phpstan": "^1.5.3",
3537
"phpstan/phpdoc-parser": "<2",
36-
"phpunit/phpunit": "^9.5"
38+
"phpunit/phpunit": "^9.6"
3739
},
3840
"autoload": {
3941
"psr-4": {
@@ -53,8 +55,8 @@
5355
},
5456
"extra": {
5557
"branch-alias": {
56-
"dev-master": "2.4.x-dev",
57-
"dev-develop": "2.5.x-dev"
58+
"dev-master": "2.6.x-dev",
59+
"dev-develop": "2.7.x-dev"
5860
}
5961
}
6062
}

src/Bag/LazyParameterBag.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function __construct()
2323
*
2424
* @return mixed|null
2525
*/
26+
#[\Override]
2627
public function get(string $key, $default = null): mixed
2728
{
2829
if (!$this->ready) {
@@ -32,6 +33,7 @@ public function get(string $key, $default = null): mixed
3233
return parent::get($key, $default);
3334
}
3435

36+
#[\Override]
3537
public function all(?string $key = null): array
3638
{
3739
if (!$this->ready) {
@@ -41,6 +43,7 @@ public function all(?string $key = null): array
4143
return parent::all();
4244
}
4345

46+
#[\Override]
4447
public function has(string $key): bool
4548
{
4649
if (!$this->ready) {
@@ -50,6 +53,7 @@ public function has(string $key): bool
5053
return parent::has($key);
5154
}
5255

56+
#[\Override]
5357
public function keys(): array
5458
{
5559
if (!$this->ready) {
@@ -60,6 +64,7 @@ public function keys(): array
6064
}
6165

6266
#[\ReturnTypeWillChange]
67+
#[\Override]
6368
public function getIterator(): \ArrayIterator
6469
{
6570
if (!$this->ready) {
@@ -70,6 +75,7 @@ public function getIterator(): \ArrayIterator
7075
}
7176

7277
#[\ReturnTypeWillChange]
78+
#[\Override]
7379
public function count(): int
7480
{
7581
if (!$this->ready) {
@@ -83,6 +89,7 @@ public function count(): int
8389
* @param null $default
8490
* @param array $options
8591
*/
92+
#[\Override]
8693
public function filter(string $key, $default = null, int $filter = \FILTER_DEFAULT, $options = []): mixed
8794
{
8895
if (!$this->ready) {

src/Core/AbstractEntities/AbstractDateTimed.php

Lines changed: 4 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
namespace RZ\Roadiz\Core\AbstractEntities;
66

77
use Doctrine\ORM\Mapping as ORM;
8-
use JMS\Serializer\Annotation as Serializer;
9-
use Symfony\Component\Serializer\Annotation as SymfonySerializer;
108

119
/**
1210
* An AbstractEntity with datetime fields to keep track of time with your items.
11+
*
12+
* @deprecated since 2.6, use composition with DateTimedTrait instead.
1313
*/
1414
#[
1515
ORM\MappedSuperclass,
@@ -18,81 +18,7 @@
1818
ORM\Index(columns: ['created_at']),
1919
ORM\Index(columns: ['updated_at']),
2020
]
21-
abstract class AbstractDateTimed extends AbstractEntity
21+
abstract class AbstractDateTimed extends AbstractEntity implements DateTimedInterface
2222
{
23-
#[
24-
ORM\Column(name: 'created_at', type: 'datetime', nullable: true),
25-
Serializer\Groups(['timestamps']),
26-
SymfonySerializer\Groups(['timestamps']),
27-
]
28-
protected ?\DateTime $createdAt = null;
29-
30-
#[
31-
ORM\Column(name: 'updated_at', type: 'datetime', nullable: true),
32-
Serializer\Groups(['timestamps']),
33-
SymfonySerializer\Groups(['timestamps']),
34-
]
35-
protected ?\DateTime $updatedAt = null;
36-
37-
public function getCreatedAt(): ?\DateTime
38-
{
39-
return $this->createdAt;
40-
}
41-
42-
/**
43-
* @return $this
44-
*/
45-
public function setCreatedAt(?\DateTime $createdAt): self
46-
{
47-
$this->createdAt = $createdAt;
48-
49-
return $this;
50-
}
51-
52-
public function getUpdatedAt(): ?\DateTime
53-
{
54-
return $this->updatedAt;
55-
}
56-
57-
/**
58-
* @return $this
59-
*/
60-
public function setUpdatedAt(?\DateTime $updatedAt): self
61-
{
62-
$this->updatedAt = $updatedAt;
63-
64-
return $this;
65-
}
66-
67-
protected function initAbstractDateTimed(): void
68-
{
69-
$this->setUpdatedAt(new \DateTime('now'));
70-
$this->setCreatedAt(new \DateTime('now'));
71-
}
72-
73-
#[ORM\PreUpdate]
74-
public function preUpdate(): void
75-
{
76-
$this->setUpdatedAt(new \DateTime('now'));
77-
}
78-
79-
#[ORM\PrePersist]
80-
public function prePersist(): void
81-
{
82-
$this->setUpdatedAt(new \DateTime('now'));
83-
$this->setCreatedAt(new \DateTime('now'));
84-
}
85-
86-
/**
87-
* Set creation and update date to *now*.
88-
*
89-
* @return $this
90-
*/
91-
public function resetDates(): self
92-
{
93-
$this->setCreatedAt(new \DateTime('now'));
94-
$this->setUpdatedAt(new \DateTime('now'));
95-
96-
return $this;
97-
}
23+
use DateTimedTrait;
9824
}

src/Core/AbstractEntities/AbstractEntity.php

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,17 @@
55
namespace RZ\Roadiz\Core\AbstractEntities;
66

77
use Doctrine\ORM\Mapping as ORM;
8-
use JMS\Serializer\Annotation as Serializer;
9-
use Symfony\Component\Serializer\Annotation as SymfonySerializer;
108

119
/**
1210
* Base entity implementing PersistableInterface to offer a unique ID.
11+
*
12+
* @deprecated since 2.6, use composition with PersistableInterface and SequentialIdTrait or UuidTrait instead.
1313
*/
1414
#[
1515
ORM\MappedSuperclass,
1616
ORM\Table
1717
]
1818
abstract class AbstractEntity implements PersistableInterface
1919
{
20-
#[
21-
ORM\Id,
22-
ORM\Column(type: 'integer'),
23-
ORM\GeneratedValue,
24-
Serializer\Groups(['id']),
25-
Serializer\Type('integer'),
26-
SymfonySerializer\Groups(['id'])
27-
]
28-
protected int|string|null $id = null;
29-
30-
public function getId(): int|string|null
31-
{
32-
return $this->id;
33-
}
34-
35-
public function setId(int|string|null $id): self
36-
{
37-
$this->id = $id;
38-
39-
return $this;
40-
}
20+
use SequentialIdTrait;
4121
}

0 commit comments

Comments
 (0)