Skip to content

Commit 54e37ea

Browse files
author
roadiz-ci
committed
chore: bumped
1 parent 7f008e0 commit 54e37ea

11 files changed

Lines changed: 24 additions & 23 deletions

.github/workflows/run-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
php-version: ['8.3', '8.4']
23+
php-version: ['8.2', '8.3']
2424
steps:
2525
- uses: shivammathur/setup-php@v2
2626
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 © 2025 Ambroise Maupate
3+
Copyright © 2024 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"description": "Roadiz sub-package which generates Typescript interfaces skeleton based on your schema",
44
"type": "library",
55
"require": {
6-
"roadiz/nodetype-contracts": "^3.0.0",
7-
"symfony/http-foundation": "7.3.*"
6+
"roadiz/nodetype-contracts": "^2.0.0",
7+
"symfony/http-foundation": "6.4.*"
88
},
99
"require-dev": {
1010
"phpstan/phpstan": "^1.5.3",
@@ -26,8 +26,8 @@
2626
},
2727
"extra": {
2828
"branch-alias": {
29-
"dev-master": "2.6.x-dev",
30-
"dev-develop": "2.7.x-dev"
29+
"dev-master": "2.5.x-dev",
30+
"dev-develop": "2.6.x-dev"
3131
}
3232
}
3333
}

src/Generators/AbstractFieldGenerator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ protected function getIntroductionLines(): array
5959

6060
public function getIntroduction(): string
6161
{
62-
return implode(PHP_EOL, array_map(fn (string $line) => static::INDENTATION_MARK.'// '.$line, $this->getIntroductionLines()));
62+
return implode(PHP_EOL, array_map(function (string $line) {
63+
return static::INDENTATION_MARK.'// '.$line;
64+
}, $this->getIntroductionLines()));
6365
}
6466
}

src/Generators/ChildrenNodeFieldGenerator.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66

77
final class ChildrenNodeFieldGenerator extends AbstractFieldGenerator
88
{
9-
#[\Override]
109
public function getContents(): string
1110
{
1211
return implode(PHP_EOL, [
1312
$this->getIntroduction(),
1413
]);
1514
}
1615

17-
#[\Override]
1816
protected function getIntroductionLines(): array
1917
{
2018
$lines = [
@@ -27,7 +25,6 @@ protected function getIntroductionLines(): array
2725
return $lines;
2826
}
2927

30-
#[\Override]
3128
protected function getType(): string
3229
{
3330
return '';

src/Generators/DeclarationGenerator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public function getContents(): string
4545

4646
private function getAllTypesInterface(): string
4747
{
48-
$nodeTypeNames = array_map(fn (NodeTypeInterface $nodeType) => $nodeType->getSourceEntityClassName(), $this->nodeTypes);
48+
$nodeTypeNames = array_map(function (NodeTypeInterface $nodeType) {
49+
return $nodeType->getSourceEntityClassName();
50+
}, $this->nodeTypes);
4951

5052
$nodeTypeNames = implode(' | ', $nodeTypeNames);
5153

src/Generators/DocumentsFieldGenerator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66

77
final class DocumentsFieldGenerator extends AbstractFieldGenerator
88
{
9-
#[\Override]
109
protected function getNullableAssertion(): string
1110
{
1211
return ''; // always available even if empty
1312
}
1413

15-
#[\Override]
1614
protected function getType(): string
1715
{
1816
return 'Array<RoadizDocument>';

src/Generators/EnumFieldGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
final class EnumFieldGenerator extends AbstractFieldGenerator
88
{
9-
#[\Override]
109
protected function getType(): string
1110
{
1211
switch (true) {
1312
case $this->field->isEnum():
1413
$defaultValues = $this->field->getDefaultValuesAsArray();
1514
if (!empty($defaultValues) && count($defaultValues) > 0) {
16-
$defaultValues = array_map(fn (string $value) => '\''.$value.'\'', $defaultValues);
15+
$defaultValues = array_map(function (string $value) {
16+
return '\''.$value.'\'';
17+
}, $defaultValues);
1718

1819
return implode(' | ', $defaultValues).' | null';
1920
}
@@ -26,7 +27,6 @@ protected function getType(): string
2627
}
2728
}
2829

29-
#[\Override]
3030
protected function getIntroductionLines(): array
3131
{
3232
$lines = parent::getIntroductionLines();

src/Generators/NodeReferencesFieldGenerator.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88

99
final class NodeReferencesFieldGenerator extends AbstractFieldGenerator
1010
{
11-
#[\Override]
1211
protected function getNullableAssertion(): string
1312
{
1413
return ''; // always available even if empty
1514
}
1615

17-
#[\Override]
1816
protected function getType(): string
1917
{
2018
return 'Array<'.$this->getUnionType().'>';
@@ -46,10 +44,11 @@ private function getUnionType(): string
4644
return 'RoadizNodesSources';
4745
}
4846

49-
return implode(' | ', array_map(fn (NodeTypeInterface $nodeType) => $nodeType->getSourceEntityClassName(), $nodeTypes));
47+
return implode(' | ', array_map(function (NodeTypeInterface $nodeType) {
48+
return $nodeType->getSourceEntityClassName();
49+
}, $nodeTypes));
5050
}
5151

52-
#[\Override]
5352
protected function getIntroductionLines(): array
5453
{
5554
$lines = parent::getIntroductionLines();

src/Generators/NodeTypeGenerator.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,15 @@ private function getIntroduction(): string
7777
$lines[] = 'Publishable: '.$this->generatorFactory->getHumanBool($this->nodeType->isPublishable());
7878
$lines[] = 'Visible: '.$this->generatorFactory->getHumanBool($this->nodeType->isVisible());
7979

80-
return implode(PHP_EOL, array_map(fn (string $line) => '// '.$line, $lines));
80+
return implode(PHP_EOL, array_map(function (string $line) {
81+
return '// '.$line;
82+
}, $lines));
8183
}
8284

8385
private function getFieldsContents(): string
8486
{
85-
return implode(PHP_EOL, array_map(fn (AbstractFieldGenerator $abstractFieldGenerator) => $abstractFieldGenerator->getContents(), $this->fieldGenerators));
87+
return implode(PHP_EOL, array_map(function (AbstractFieldGenerator $abstractFieldGenerator) {
88+
return $abstractFieldGenerator->getContents();
89+
}, $this->fieldGenerators));
8690
}
8791
}

0 commit comments

Comments
 (0)