Skip to content

Commit 07d3458

Browse files
Improve type declarations
1 parent aee0ec0 commit 07d3458

File tree

5 files changed

+17
-41
lines changed

5 files changed

+17
-41
lines changed

.psalm/baseline.xml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.12.0@f90118cdeacd0088e7215e64c0c99ceca819e176">
2+
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
33
<file src="src/Framework/Assert.php">
44
<ArgumentTypeCoercion>
55
<code><![CDATA[$actualElement->childNodes->item($i)]]></code>
@@ -679,11 +679,6 @@
679679
<code><![CDATA[$t->getPrevious()]]></code>
680680
</PossiblyNullArgument>
681681
</file>
682-
<file src="src/Framework/IncompleteTestCase.php">
683-
<NonInvariantDocblockPropertyType>
684-
<code>$backupGlobals</code>
685-
</NonInvariantDocblockPropertyType>
686-
</file>
687682
<file src="src/Framework/MockObject/Builder/Identity.php">
688683
<MissingReturnType>
689684
<code>id</code>
@@ -969,11 +964,6 @@
969964
<code>invoke</code>
970965
</MissingReturnType>
971966
</file>
972-
<file src="src/Framework/SkippedTestCase.php">
973-
<NonInvariantDocblockPropertyType>
974-
<code>$backupGlobals</code>
975-
</NonInvariantDocblockPropertyType>
976-
</file>
977967
<file src="src/Framework/TestBuilder.php">
978968
<MissingParamType>
979969
<code>$data</code>
@@ -1003,12 +993,9 @@
1003993
<code>setMethods</code>
1004994
</DeprecatedMethod>
1005995
<DocblockTypeContradiction>
1006-
<code><![CDATA[$this->backupStaticAttributes === null]]></code>
1007996
<code><![CDATA[$this->mockObjectGenerator === null]]></code>
1008997
<code><![CDATA[$this->name === null]]></code>
1009998
<code><![CDATA[$this->prophet === null]]></code>
1010-
<code><![CDATA[$this->runClassInSeparateProcess === null]]></code>
1011-
<code><![CDATA[$this->runTestInSeparateProcess === null]]></code>
1012999
<code><![CDATA['']]></code>
10131000
<code><![CDATA[is_int($this->dataName)]]></code>
10141001
</DocblockTypeContradiction>
@@ -1196,20 +1183,14 @@
11961183
<code>$categories</code>
11971184
</PossiblyUndefinedVariable>
11981185
<PropertyNotSetInConstructor>
1199-
<code>$backupStaticAttributes</code>
12001186
<code>$mockObjectGenerator</code>
12011187
<code>$outputBufferingLevel</code>
12021188
<code>$outputExpectedRegex</code>
12031189
<code>$outputExpectedString</code>
12041190
<code>$prophet</code>
12051191
<code>$result</code>
1206-
<code>$runClassInSeparateProcess</code>
1207-
<code>$runTestInSeparateProcess</code>
12081192
<code>$snapshot</code>
12091193
</PropertyNotSetInConstructor>
1210-
<RedundantCastGivenDocblockType>
1211-
<code><![CDATA[(bool) $this->backupStaticAttributes]]></code>
1212-
</RedundantCastGivenDocblockType>
12131194
<RedundantCondition>
12141195
<code>$this instanceof PhptTestCase</code>
12151196
</RedundantCondition>
@@ -1400,11 +1381,6 @@
14001381
<code><![CDATA[null === $this->beStrictAboutChangesToGlobalState && is_bool($beStrictAboutChangesToGlobalState)]]></code>
14011382
</RedundantConditionGivenDocblockType>
14021383
</file>
1403-
<file src="src/Framework/WarningTestCase.php">
1404-
<NonInvariantDocblockPropertyType>
1405-
<code>$backupGlobals</code>
1406-
</NonInvariantDocblockPropertyType>
1407-
</file>
14081384
<file src="src/Runner/Filter/Factory.php">
14091385
<MissingParamType>
14101386
<code>$args</code>

src/Framework/IncompleteTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
final class IncompleteTestCase extends TestCase
1616
{
1717
/**
18-
* @var bool
18+
* @var ?bool
1919
*/
2020
protected $backupGlobals = false;
2121

2222
/**
23-
* @var bool
23+
* @var ?bool
2424
*/
2525
protected $backupStaticAttributes = false;
2626

2727
/**
28-
* @var bool
28+
* @var ?bool
2929
*/
3030
protected $runTestInSeparateProcess = false;
3131

src/Framework/SkippedTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
final class SkippedTestCase extends TestCase
1616
{
1717
/**
18-
* @var bool
18+
* @var ?bool
1919
*/
2020
protected $backupGlobals = false;
2121

2222
/**
23-
* @var bool
23+
* @var ?bool
2424
*/
2525
protected $backupStaticAttributes = false;
2626

2727
/**
28-
* @var bool
28+
* @var ?bool
2929
*/
3030
protected $runTestInSeparateProcess = false;
3131

src/Framework/TestCase.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ abstract class TestCase extends Assert implements SelfDescribing, Test
127127
protected $backupGlobalsBlacklist = [];
128128

129129
/**
130-
* @var bool
130+
* @var ?bool
131131
*/
132132
protected $backupStaticAttributes;
133133

@@ -137,7 +137,7 @@ abstract class TestCase extends Assert implements SelfDescribing, Test
137137
protected $backupStaticAttributesBlacklist = [];
138138

139139
/**
140-
* @var bool
140+
* @var ?bool
141141
*/
142142
protected $runTestInSeparateProcess;
143143

@@ -147,7 +147,7 @@ abstract class TestCase extends Assert implements SelfDescribing, Test
147147
protected $preserveGlobalState = true;
148148

149149
/**
150-
* @var bool
150+
* @var ?bool
151151
*/
152152
private $runClassInSeparateProcess;
153153

@@ -167,17 +167,17 @@ abstract class TestCase extends Assert implements SelfDescribing, Test
167167
private $dataName;
168168

169169
/**
170-
* @var null|string
170+
* @var ?string
171171
*/
172172
private $expectedException;
173173

174174
/**
175-
* @var null|string
175+
* @var ?string
176176
*/
177177
private $expectedExceptionMessage;
178178

179179
/**
180-
* @var null|string
180+
* @var ?string
181181
*/
182182
private $expectedExceptionMessageRegExp;
183183

@@ -1961,7 +1961,7 @@ protected function getObjectForTrait($traitName, array $arguments = [], $traitCl
19611961
}
19621962

19631963
/**
1964-
* @param null|string $classOrInterface
1964+
* @param ?string $classOrInterface
19651965
*
19661966
* @throws \Prophecy\Exception\Doubler\ClassNotFoundException
19671967
* @throws \Prophecy\Exception\Doubler\DoubleException

src/Framework/WarningTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
final class WarningTestCase extends TestCase
1616
{
1717
/**
18-
* @var bool
18+
* @var ?bool
1919
*/
2020
protected $backupGlobals = false;
2121

2222
/**
23-
* @var bool
23+
* @var ?bool
2424
*/
2525
protected $backupStaticAttributes = false;
2626

2727
/**
28-
* @var bool
28+
* @var ?bool
2929
*/
3030
protected $runTestInSeparateProcess = false;
3131

0 commit comments

Comments
 (0)