Skip to content

Commit 0275c11

Browse files
committed
fix phpstan and tests
1 parent eae4e1c commit 0275c11

File tree

11 files changed

+47
-112
lines changed

11 files changed

+47
-112
lines changed

composer.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

functional/Mapping/Composite/ObjectMapperTest.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717
use Symfony\Component\PropertyAccess\PropertyPath;
1818
use Symfony\Component\PropertyAccess\PropertyPathInterface;
1919

20-
/**
21-
* @internal
22-
*/
23-
#[\PHPUnit\Framework\Attributes\CoversNothing]
24-
/**
25-
* @internal
26-
*
27-
* @coversNothing
28-
*/
2920
final class ObjectMapperTest extends TestCase
3021
{
3122
public static function mappingDataProvider()
@@ -64,10 +55,9 @@ public static function mappingDataProvider()
6455
}
6556

6657
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
67-
#[\PHPUnit\Framework\Attributes\Test]
68-
public function dynamicResults(
69-
mixed $expected,
70-
mixed $input,
58+
public function testDynamicResults(
59+
$expected,
60+
$input,
7161
ExpressionLanguage $interpreter,
7262
PropertyPathInterface $outputField,
7363
Expression ...$expression
@@ -84,10 +74,9 @@ public function dynamicResults(
8474
}
8575

8676
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
87-
#[\PHPUnit\Framework\Attributes\Test]
88-
public function compilationResultsWithSpaghettiStrategy(
89-
mixed $expected,
90-
mixed $input,
77+
public function testCompilationResultsWithSpaghettiStrategy(
78+
$expected,
79+
$input,
9180
ExpressionLanguage $interpreter,
9281
PropertyPathInterface $outputField,
9382
Expression ...$expression

functional/Mapping/Field/ConcatCopyValuesMapperTest.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
use Symfony\Component\PropertyAccess\PropertyPath;
1313
use Symfony\Component\PropertyAccess\PropertyPathInterface;
1414

15-
/**
16-
* @internal
17-
*/
18-
#[\PHPUnit\Framework\Attributes\CoversNothing]
19-
/**
20-
* @internal
21-
*
22-
* @coversNothing
23-
*/
2415
final class ConcatCopyValuesMapperTest extends TestCase
2516
{
2617
public static function mappingDataProvider()
@@ -108,10 +99,9 @@ public static function mappingDataProvider()
10899
}
109100

110101
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
111-
#[\PHPUnit\Framework\Attributes\Test]
112-
public function dynamicResults(
113-
mixed $expected,
114-
mixed $input,
102+
public function testDynamicResults(
103+
$expected,
104+
$input,
115105
PropertyPathInterface $outputField,
116106
string $glue,
117107
PropertyPathInterface ...$inputFields
@@ -123,10 +113,9 @@ public function dynamicResults(
123113
}
124114

125115
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
126-
#[\PHPUnit\Framework\Attributes\Test]
127-
public function compilationResultsWithSpaghettiStrategy(
128-
mixed $expected,
129-
mixed $input,
116+
public function testCompilationResultsWithSpaghettiStrategy(
117+
$expected,
118+
$input,
130119
PropertyPathInterface $outputField,
131120
string $glue,
132121
PropertyPathInterface ...$inputFields

functional/Mapping/Field/ConstantValueMapperTest.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
use Symfony\Component\PropertyAccess\PropertyPath;
1313
use Symfony\Component\PropertyAccess\PropertyPathInterface;
1414

15-
/**
16-
* @internal
17-
*/
18-
#[\PHPUnit\Framework\Attributes\CoversNothing]
19-
/**
20-
* @internal
21-
*
22-
* @coversNothing
23-
*/
2415
final class ConstantValueMapperTest extends TestCase
2516
{
2617
public static function mappingDataProvider()
@@ -100,10 +91,9 @@ public static function mappingDataProvider()
10091
}
10192

10293
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
103-
#[\PHPUnit\Framework\Attributes\Test]
104-
public function dynamicResults(
105-
mixed $expected,
106-
mixed $input,
94+
public function testDynamicResults(
95+
$expected,
96+
$input,
10797
PropertyPathInterface $outputField,
10898
string $constantValue
10999
): void {
@@ -114,10 +104,9 @@ public function dynamicResults(
114104
}
115105

116106
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
117-
#[\PHPUnit\Framework\Attributes\Test]
118-
public function compilationResultsWithSpaghettiStrategy(
119-
mixed $expected,
120-
mixed $input,
107+
public function testCompilationResultsWithSpaghettiStrategy(
108+
$expected,
109+
$input,
121110
PropertyPathInterface $outputField,
122111
string $constantValue
123112
): void {

functional/Mapping/Field/CopyValueMapperTest.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
use Symfony\Component\PropertyAccess\PropertyPath;
1313
use Symfony\Component\PropertyAccess\PropertyPathInterface;
1414

15-
/**
16-
* @internal
17-
*/
18-
#[\PHPUnit\Framework\Attributes\CoversNothing]
19-
/**
20-
* @internal
21-
*
22-
* @coversNothing
23-
*/
2415
final class CopyValueMapperTest extends TestCase
2516
{
2617
public static function mappingDataProvider()
@@ -100,10 +91,9 @@ public static function mappingDataProvider()
10091
}
10192

10293
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
103-
#[\PHPUnit\Framework\Attributes\Test]
104-
public function dynamicResults(
105-
mixed $expected,
106-
mixed $input,
94+
public function testDynamicResults(
95+
$expected,
96+
$input,
10797
PropertyPathInterface $outputField,
10898
PropertyPathInterface $inputField
10999
): void {
@@ -114,10 +104,9 @@ public function dynamicResults(
114104
}
115105

116106
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
117-
#[\PHPUnit\Framework\Attributes\Test]
118-
public function compilationResultsWithSpaghettiStrategy(
119-
mixed $expected,
120-
mixed $input,
107+
public function testCompilationResultsWithSpaghettiStrategy(
108+
$expected,
109+
$input,
121110
PropertyPathInterface $outputField,
122111
PropertyPathInterface $inputField
123112
): void {

functional/Mapping/Field/ExpressionLanguageValueMapperTest.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
use Symfony\Component\PropertyAccess\PropertyPath;
1515
use Symfony\Component\PropertyAccess\PropertyPathInterface;
1616

17-
/**
18-
* @internal
19-
*/
20-
#[\PHPUnit\Framework\Attributes\CoversNothing]
21-
/**
22-
* @internal
23-
*
24-
* @coversNothing
25-
*/
2617
final class ExpressionLanguageValueMapperTest extends TestCase
2718
{
2819
public static function mappingDataProvider()
@@ -140,10 +131,9 @@ public static function mappingDataProvider()
140131
}
141132

142133
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
143-
#[\PHPUnit\Framework\Attributes\Test]
144-
public function dynamicResults(
145-
mixed $expected,
146-
mixed $input,
134+
public function testDynamicResults(
135+
$expected,
136+
$input,
147137
PropertyPathInterface $outputField,
148138
Expression $expression,
149139
ExpressionLanguage $interpreter
@@ -155,10 +145,9 @@ public function dynamicResults(
155145
}
156146

157147
#[\PHPUnit\Framework\Attributes\DataProvider('mappingDataProvider')]
158-
#[\PHPUnit\Framework\Attributes\Test]
159-
public function compilationResultsWithSpaghettiStrategy(
160-
mixed $expected,
161-
mixed $input,
148+
public function testCompilationResultsWithSpaghettiStrategy(
149+
$expected,
150+
$input,
162151
PropertyPathInterface $outputField,
163152
Expression $expression,
164153
ExpressionLanguage $interpreter

functional/MappingTest.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@
3030
use PhpParser\ParserFactory;
3131
use PHPUnit\Framework\TestCase;
3232

33-
/**
34-
* @internal
35-
*/
36-
#[\PHPUnit\Framework\Attributes\CoversNothing]
37-
/**
38-
* @internal
39-
*
40-
* @coversNothing
41-
*/
4233
final class MappingTest extends TestCase
4334
{
4435
public static function dataProvider()
@@ -196,8 +187,7 @@ public static function dataProvider()
196187
}
197188

198189
#[\PHPUnit\Framework\Attributes\DataProvider('dataProvider')]
199-
#[\PHPUnit\Framework\Attributes\Test]
200-
public function mapping(ClassTypeMetadata $expected): void
190+
public function testMapping(ClassTypeMetadata $expected)
201191
{
202192
$typeGuesser = new CompositeTypeGuesser(
203193
new NativeTypeGuesser(),

src/Compiler/Builder/ExpressionLanguageToPhpParserBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function getNode(): Node\Expr
2929
;
3030

3131
/** @var Node\Expr $inputNodes */
32-
$inputNodes = $inputNodes[0];
32+
$inputNode = $inputNodes[0];
3333

34-
return $inputNodes[0]->expr;
34+
return $inputNode->expr;
3535
}
3636
}

src/Mapping/Composite/ArrayMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function compile(Node\Expr $outputNode): array
6464
),
6565
),
6666
],
67-
array_merge(
67+
(array) array_merge(
6868
...$this->compileMappers(new Node\Expr\Variable('output'))
6969
),
7070
[

src/Mapping/MultipleRelation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(
2323
private PropertyPathInterface $outputPath,
2424
private readonly ExpressionLanguage $interpreter,
2525
private readonly Expression $inputExpression,
26-
private readonly Mapping\ObjectMapperInterface $child
26+
private readonly Mapping\CompilableMapperInterface $child
2727
) {
2828
$this->accessor = PropertyAccess::createPropertyAccessor();
2929
}

0 commit comments

Comments
 (0)