Skip to content

Commit 5251d49

Browse files
emodricNyholm
authored andcommitted
Add return typehints to toString methods for compatibility with PHPUnit 7 (#93)
1 parent 8818b3a commit 5251d49

8 files changed

+8
-8
lines changed

PhpUnit/ContainerBuilderHasAliasConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct($aliasId, $expectedServiceId = null)
2727
$this->expectedServiceId = $expectedServiceId;
2828
}
2929

30-
public function toString()
30+
public function toString(): string
3131
{
3232
return 'has an alias "' . $this->aliasId . '" for service "' . $this->expectedServiceId . '"';
3333
}

PhpUnit/ContainerBuilderHasServiceDefinitionConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct($serviceId, $expectedClass = null, $checkExpectedCla
2929
$this->checkExpectedClass = $checkExpectedClass;
3030
}
3131

32-
public function toString()
32+
public function toString(): string
3333
{
3434
return sprintf(
3535
'has a service definition "%s" with class "%s"',

PhpUnit/ContainerBuilderHasSyntheticServiceConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct($serviceId)
2020
$this->serviceId = $serviceId;
2121
}
2222

23-
public function toString()
23+
public function toString(): string
2424
{
2525
return sprintf(
2626
'has a synthetic service "%s"',

PhpUnit/ContainerHasParameterConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct($parameterName, $expectedParameterValue = null, $che
2121
$this->checkParameterValue = $checkParameterValue;
2222
}
2323

24-
public function toString()
24+
public function toString(): string
2525
{
2626
return sprintf(
2727
'has a parameter "%s" with the given value',

PhpUnit/DefinitionHasArgumentConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct($argumentIndex, $expectedValue, $checkExpectedValue
4242
$this->checkExpectedValue = $checkExpectedValue;
4343
}
4444

45-
public function toString()
45+
public function toString(): string
4646
{
4747
if (is_string($this->argumentIndex)) {
4848
return sprintf(

PhpUnit/DefinitionHasMethodCallConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function evaluate($other, $description = '', $returnResult = false)
6666
return false;
6767
}
6868

69-
public function toString()
69+
public function toString(): string
7070
{
7171
if (null !== $this->index) {
7272
return sprintf(

PhpUnit/DefinitionHasTagConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function evaluate($other, $description = '', $returnResult = false)
6262
return false;
6363
}
6464

65-
public function toString()
65+
public function toString(): string
6666
{
6767
return sprintf(
6868
'has the "%s" tag with the given attributes',

PhpUnit/DefinitionIsChildOfConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function evaluate($other, $description = '', $returnResult = false)
3737
return true;
3838
}
3939

40-
public function toString()
40+
public function toString(): string
4141
{
4242
return sprintf(
4343
'is a child of service "%s"',

0 commit comments

Comments
 (0)