Skip to content

Commit 7db448e

Browse files
author
roadiz-ci
committed
Merge tag v2.7.0 into develop
1 parent b6881c2 commit 7db448e

9 files changed

Lines changed: 31 additions & 59 deletions

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
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/DateTimedTrait.php

Lines changed: 4 additions & 8 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

src/Core/AbstractEntities/PositionedTrait.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
*/
1616
trait PositionedTrait
1717
{
18-
#[
19-
ORM\Column(type: 'float'),
18+
#[ORM\Column(type: 'float'),
2019
Serializer\Groups(['position']),
2120
ApiFilter(RangeFilter::class),
22-
ApiFilter(NumericFilter::class)
23-
]
21+
ApiFilter(NumericFilter::class)]
2422
protected float $position = 0.0;
2523

2624
public function getPosition(): float

src/Core/AbstractEntities/SequentialIdTrait.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99

1010
trait SequentialIdTrait
1111
{
12-
#[
13-
ORM\Id,
12+
#[ORM\Id,
1413
ORM\Column(type: 'integer'),
1514
ORM\GeneratedValue,
16-
Serializer\Groups(['id'])
17-
]
15+
Serializer\Groups(['id'])]
1816
protected ?int $id = null;
1917

2018
public function getId(): ?int

src/Utils/StringHandler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@ public static function encodeWithSecret(?string $value, ?string $secret): string
145145
$secret = crypt($secret, $secret);
146146

147147
return base64_encode($secret.base64_encode(strip_tags($value ?? '')));
148-
} else {
149-
throw new \InvalidArgumentException('You cannot encode with an empty salt. Did you enter a secret security phrase in your conf/config.json file?', 1);
150148
}
149+
throw new \InvalidArgumentException('You cannot encode with an empty salt. Did you enter a secret security phrase in your conf/config.json file?', 1);
151150
}
152151

153152
/**
@@ -169,9 +168,8 @@ public static function decodeWithSecret(?string $value, ?string $secret): string
169168
$nonSalted = str_replace($secret, '', $salted);
170169

171170
return base64_decode($nonSalted);
172-
} else {
173-
throw new \InvalidArgumentException('You cannot encode with an empty salt. Did you enter a secret security phrase in your conf/config.json file?', 1);
174171
}
172+
throw new \InvalidArgumentException('You cannot encode with an empty salt. Did you enter a secret security phrase in your conf/config.json file?', 1);
175173
}
176174

177175
/**

0 commit comments

Comments
 (0)