Skip to content

Commit 52a3796

Browse files
Merge branch '9.4' into master
2 parents c9ebc97 + 1a2719e commit 52a3796

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

.psalm/baseline.xml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,7 @@
456456
</MissingParamType>
457457
</file>
458458
<file src="src/Framework/MockObject/Generator.php">
459-
<ArgumentTypeCoercion occurrences="4">
460-
<code>$className</code>
459+
<ArgumentTypeCoercion occurrences="3">
461460
<code>$className</code>
462461
<code>$className</code>
463462
<code>$interfaceName</code>
@@ -469,9 +468,6 @@
469468
<InvalidReturnType occurrences="1">
470469
<code>MockObject&amp;RealInstanceType</code>
471470
</InvalidReturnType>
472-
<InvalidStringClass occurrences="1">
473-
<code>new $className</code>
474-
</InvalidStringClass>
475471
<MissingParamType occurrences="1">
476472
<code>$type</code>
477473
</MissingParamType>
@@ -1323,20 +1319,6 @@
13231319
<code>getName</code>
13241320
</UndefinedInterfaceMethod>
13251321
</file>
1326-
<file src="src/Util/Metadata/Group.php">
1327-
<InvalidPropertyAssignmentValue occurrences="1">
1328-
<code>$enabled</code>
1329-
</InvalidPropertyAssignmentValue>
1330-
<InvalidReturnStatement occurrences="1">
1331-
<code>$this-&gt;groupName</code>
1332-
</InvalidReturnStatement>
1333-
<InvalidReturnType occurrences="1">
1334-
<code>bool</code>
1335-
</InvalidReturnType>
1336-
</file>
1337-
<file src="src/Util/Metadata/MetadataCollection.php">
1338-
<InvalidArgument occurrences="1"/>
1339-
</file>
13401322
<file src="src/Util/PHP/AbstractPhpProcess.php">
13411323
<ArgumentTypeCoercion occurrences="2">
13421324
<code>$this-&gt;getException($failures[0])</code>

src/Framework/MockObject/MockClass.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class MockClass implements MockType
2323
private $classCode;
2424

2525
/**
26-
* @var string
26+
* @var class-string
2727
*/
2828
private $mockName;
2929

@@ -32,13 +32,19 @@ final class MockClass implements MockType
3232
*/
3333
private $configurableMethods;
3434

35+
/**
36+
* @psalm-param class-string $mockName
37+
*/
3538
public function __construct(string $classCode, string $mockName, array $configurableMethods)
3639
{
3740
$this->classCode = $classCode;
3841
$this->mockName = $mockName;
3942
$this->configurableMethods = $configurableMethods;
4043
}
4144

45+
/**
46+
* @psalm-return class-string
47+
*/
4248
public function generate(): string
4349
{
4450
if (!class_exists($this->mockName, false)) {

src/Framework/MockObject/MockTrait.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,22 @@ final class MockTrait implements MockType
2222
private $classCode;
2323

2424
/**
25-
* @var string
25+
* @var class-string
2626
*/
2727
private $mockName;
2828

29+
/**
30+
* @psalm-param class-string $mockName
31+
*/
2932
public function __construct(string $classCode, string $mockName)
3033
{
3134
$this->classCode = $classCode;
3235
$this->mockName = $mockName;
3336
}
3437

38+
/**
39+
* @psalm-return class-string
40+
*/
3541
public function generate(): string
3642
{
3743
if (!class_exists($this->mockName, false)) {

src/Framework/MockObject/MockType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
*/
1515
interface MockType
1616
{
17+
/**
18+
* @psalm-return class-string
19+
*/
1720
public function generate(): string;
1821
}

0 commit comments

Comments
 (0)