Skip to content

Commit 8d4dd6c

Browse files
author
roadiz-ci
committed
chore(Rozier): Built assets
1 parent 0bd72a1 commit 8d4dd6c

20 files changed

Lines changed: 263 additions & 1375 deletions

.github/workflows/run-test.yml

Lines changed: 1 addition & 3 deletions
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.1', '8.2', '8.3']
22+
php-version: ['8.2', '8.3']
2323
steps:
2424
- uses: shivammathur/setup-php@v2
2525
with:
@@ -37,7 +37,5 @@ jobs:
3737
run: composer install --no-scripts --no-ansi --no-interaction --no-progress
3838
- name: Run PHPUnit tests
3939
run: vendor/bin/phpunit -v --whitelist ./src tests
40-
- name: Run PHP Code Sniffer
41-
run: vendor/bin/phpcs -p ./src
4240
- name: Run PHPStan
4341
run: vendor/bin/phpstan analyse --no-progress -c phpstan.neon

composer.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,22 @@
1818
}
1919
],
2020
"require": {
21-
"php": ">=8.1",
22-
"doctrine/orm": "~2.19.0",
23-
"jms/serializer": "^3.9.0",
21+
"php": ">=8.2",
22+
"doctrine/orm": "~2.20.0",
23+
"jms/serializer": "^3.32.3",
24+
"roadiz/nodetype-contracts": "^2.0.0",
2425
"symfony/string": "6.4.*",
2526
"symfony/translation-contracts": "^3.0",
2627
"symfony/http-foundation": "6.4.*",
2728
"symfony/serializer": "6.4.*",
2829
"symfony/validator": "6.4.*"
2930
},
3031
"require-dev": {
31-
"phpunit/phpunit": "^9.5",
32+
"doctrine/doctrine-bundle": "^2.8.1",
3233
"php-coveralls/php-coveralls": "^2.4",
33-
"squizlabs/php_codesniffer": "^3.5",
34-
"phpstan/phpstan": "^1.5.3"
34+
"phpstan/phpstan": "^1.5.3",
35+
"phpstan/phpdoc-parser": "<2",
36+
"phpunit/phpunit": "^9.5"
3537
},
3638
"autoload": {
3739
"psr-4": {
@@ -51,8 +53,8 @@
5153
},
5254
"extra": {
5355
"branch-alias": {
54-
"dev-master": "2.3.x-dev",
55-
"dev-develop": "2.4.x-dev"
56+
"dev-master": "2.5.x-dev",
57+
"dev-develop": "2.6.x-dev"
5658
}
5759
}
5860
}

phpcs.xml.dist

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Bag/LazyParameterBag.php

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public function __construct()
1919
}
2020

2121
/**
22-
* @param string $key
2322
* @param mixed|null $default
23+
*
2424
* @return mixed|null
2525
*/
2626
public function get(string $key, $default = null): mixed
@@ -32,11 +32,7 @@ public function get(string $key, $default = null): mixed
3232
return parent::get($key, $default);
3333
}
3434

35-
/**
36-
* @param string|null $key
37-
* @return array
38-
*/
39-
public function all(string $key = null): array
35+
public function all(?string $key = null): array
4036
{
4137
if (!$this->ready) {
4238
$this->populateParameters();
@@ -45,11 +41,6 @@ public function all(string $key = null): array
4541
return parent::all();
4642
}
4743

48-
/**
49-
* @param string $key
50-
*
51-
* @return bool
52-
*/
5344
public function has(string $key): bool
5445
{
5546
if (!$this->ready) {
@@ -59,9 +50,6 @@ public function has(string $key): bool
5950
return parent::has($key);
6051
}
6152

62-
/**
63-
* @return array
64-
*/
6553
public function keys(): array
6654
{
6755
if (!$this->ready) {
@@ -71,9 +59,6 @@ public function keys(): array
7159
return parent::keys();
7260
}
7361

74-
/**
75-
* @return \ArrayIterator
76-
*/
7762
#[\ReturnTypeWillChange]
7863
public function getIterator(): \ArrayIterator
7964
{
@@ -84,9 +69,6 @@ public function getIterator(): \ArrayIterator
8469
return parent::getIterator();
8570
}
8671

87-
/**
88-
* @return int
89-
*/
9072
#[\ReturnTypeWillChange]
9173
public function count(): int
9274
{
@@ -98,12 +80,8 @@ public function count(): int
9880
}
9981

10082
/**
101-
* @param string $key
102-
* @param null $default
103-
* @param int $filter
104-
* @param array $options
105-
*
106-
* @return mixed
83+
* @param null $default
84+
* @param array $options
10785
*/
10886
public function filter(string $key, $default = null, int $filter = \FILTER_DEFAULT, $options = []): mixed
10987
{

src/Core/AbstractEntities/AbstractDateTimed.php

Lines changed: 31 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,112 +4,94 @@
44

55
namespace RZ\Roadiz\Core\AbstractEntities;
66

7-
use DateTime;
87
use Doctrine\ORM\Mapping as ORM;
98
use JMS\Serializer\Annotation as Serializer;
109
use Symfony\Component\Serializer\Annotation as SymfonySerializer;
1110

1211
/**
1312
* An AbstractEntity with datetime fields to keep track of time with your items.
1413
*/
15-
1614
#[
1715
ORM\MappedSuperclass,
1816
ORM\HasLifecycleCallbacks,
1917
ORM\Table,
20-
ORM\Index(columns: ["created_at"]),
21-
ORM\Index(columns: ["updated_at"]),
18+
ORM\Index(columns: ['created_at']),
19+
ORM\Index(columns: ['updated_at']),
2220
]
2321
abstract class AbstractDateTimed extends AbstractEntity
2422
{
25-
/**
26-
* @var DateTime|null
27-
*/
2823
#[
29-
ORM\Column(name: "created_at", type: "datetime", nullable: true),
30-
Serializer\Groups(["timestamps"]),
31-
SymfonySerializer\Groups(["timestamps"]),
24+
ORM\Column(name: 'created_at', type: 'datetime', nullable: true),
25+
Serializer\Groups(['timestamps']),
26+
SymfonySerializer\Groups(['timestamps']),
3227
]
33-
protected ?DateTime $createdAt = null;
28+
protected ?\DateTime $createdAt = null;
3429

35-
/**
36-
* @var DateTime|null
37-
*/
3830
#[
39-
ORM\Column(name: "updated_at", type: "datetime", nullable: true),
40-
Serializer\Groups(["timestamps"]),
41-
SymfonySerializer\Groups(["timestamps"]),
31+
ORM\Column(name: 'updated_at', type: 'datetime', nullable: true),
32+
Serializer\Groups(['timestamps']),
33+
SymfonySerializer\Groups(['timestamps']),
4234
]
43-
protected ?DateTime $updatedAt = null;
35+
protected ?\DateTime $updatedAt = null;
4436

45-
/**
46-
* @return DateTime|null
47-
*/
48-
public function getCreatedAt(): ?DateTime
37+
public function getCreatedAt(): ?\DateTime
4938
{
5039
return $this->createdAt;
5140
}
5241

5342
/**
54-
* @param DateTime|null $createdAt
55-
* @return AbstractDateTimed
43+
* @return $this
5644
*/
57-
public function setCreatedAt(?DateTime $createdAt)
45+
public function setCreatedAt(?\DateTime $createdAt): self
5846
{
5947
$this->createdAt = $createdAt;
48+
6049
return $this;
6150
}
6251

63-
/**
64-
* @return DateTime|null
65-
*/
66-
public function getUpdatedAt(): ?DateTime
52+
public function getUpdatedAt(): ?\DateTime
6753
{
6854
return $this->updatedAt;
6955
}
7056

7157
/**
72-
* @param DateTime|null $updatedAt
73-
* @return AbstractDateTimed
58+
* @return $this
7459
*/
75-
public function setUpdatedAt(?DateTime $updatedAt)
60+
public function setUpdatedAt(?\DateTime $updatedAt): self
7661
{
7762
$this->updatedAt = $updatedAt;
63+
7864
return $this;
7965
}
8066

8167
protected function initAbstractDateTimed(): void
8268
{
83-
$this->setUpdatedAt(new DateTime("now"));
84-
$this->setCreatedAt(new DateTime("now"));
69+
$this->setUpdatedAt(new \DateTime('now'));
70+
$this->setCreatedAt(new \DateTime('now'));
8571
}
8672

87-
/**
88-
* @return void
89-
*/
9073
#[ORM\PreUpdate]
91-
public function preUpdate()
74+
public function preUpdate(): void
9275
{
93-
$this->setUpdatedAt(new DateTime("now"));
76+
$this->setUpdatedAt(new \DateTime('now'));
9477
}
95-
/**
96-
* @return void
97-
*/
78+
9879
#[ORM\PrePersist]
99-
public function prePersist()
80+
public function prePersist(): void
10081
{
101-
$this->setUpdatedAt(new DateTime("now"));
102-
$this->setCreatedAt(new DateTime("now"));
82+
$this->setUpdatedAt(new \DateTime('now'));
83+
$this->setCreatedAt(new \DateTime('now'));
10384
}
85+
10486
/**
10587
* Set creation and update date to *now*.
10688
*
107-
* @return AbstractEntity
89+
* @return $this
10890
*/
109-
public function resetDates()
91+
public function resetDates(): self
11092
{
111-
$this->setCreatedAt(new DateTime("now"));
112-
$this->setUpdatedAt(new DateTime("now"));
93+
$this->setCreatedAt(new \DateTime('now'));
94+
$this->setUpdatedAt(new \DateTime('now'));
11395

11496
return $this;
11597
}

src/Core/AbstractEntities/AbstractEntity.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,25 @@
1717
]
1818
abstract class AbstractEntity implements PersistableInterface
1919
{
20-
/**
21-
* @var int|string|null
22-
*/
2320
#[
2421
ORM\Id,
25-
ORM\Column(type: "integer"),
22+
ORM\Column(type: 'integer'),
2623
ORM\GeneratedValue,
27-
Serializer\Groups(["id"]),
28-
Serializer\Type("integer"),
29-
SymfonySerializer\Groups(["id"])
24+
Serializer\Groups(['id']),
25+
Serializer\Type('integer'),
26+
SymfonySerializer\Groups(['id'])
3027
]
3128
protected int|string|null $id = null;
3229

33-
/**
34-
* @return int|string|null
35-
*/
3630
public function getId(): int|string|null
3731
{
3832
return $this->id;
3933
}
4034

41-
/**
42-
* @param int|string|null $id
43-
* @return AbstractEntity
44-
*/
4535
public function setId(int|string|null $id): self
4636
{
4737
$this->id = $id;
38+
4839
return $this;
4940
}
5041
}

0 commit comments

Comments
 (0)