Skip to content

Commit eb22ea1

Browse files
Merge branch '9.6' into 10.5
2 parents 8d675f8 + dd98a2a commit eb22ea1

File tree

9 files changed

+13
-12
lines changed

9 files changed

+13
-12
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
'no_whitespace_in_blank_line' => true,
202202
'non_printable_character' => true,
203203
'normalize_index_brace' => true,
204+
'nullable_type_declaration_for_default_null_value' => true,
204205
'object_operator_without_whitespace' => true,
205206
'octal_notation' => true,
206207
'operator_linebreak' => [

src/Framework/Constraint/Constraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function matches(mixed $other): bool
8686
*
8787
* @throws ExpectationFailedException
8888
*/
89-
protected function fail(mixed $other, string $description, ComparisonFailure $comparisonFailure = null): never
89+
protected function fail(mixed $other, string $description, ?ComparisonFailure $comparisonFailure = null): never
9090
{
9191
$failureDescription = sprintf(
9292
'Failed asserting that %s.',

src/Framework/Constraint/JsonMatches.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function matches(mixed $other): bool
6868
* @throws ExpectationFailedException
6969
* @throws InvalidJsonException
7070
*/
71-
protected function fail(mixed $other, string $description, ComparisonFailure $comparisonFailure = null): never
71+
protected function fail(mixed $other, string $description, ?ComparisonFailure $comparisonFailure = null): never
7272
{
7373
if ($comparisonFailure === null) {
7474
[$error, $recodedOther] = Json::canonicalize($other);

src/Framework/Exception/Exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Exception extends RuntimeException implements \PHPUnit\Exception
4040
{
4141
protected array $serializableTrace;
4242

43-
public function __construct(string $message = '', int $code = 0, Throwable $previous = null)
43+
public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null)
4444
{
4545
parent::__construct($message, $code, $previous);
4646

src/Framework/Exception/ExpectationFailedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class ExpectationFailedException extends AssertionFailedError
2525
{
2626
protected ?ComparisonFailure $comparisonFailure = null;
2727

28-
public function __construct(string $message, ComparisonFailure $comparisonFailure = null, Exception $previous = null)
28+
public function __construct(string $message, ?ComparisonFailure $comparisonFailure = null, ?Exception $previous = null)
2929
{
3030
$this->comparisonFailure = $comparisonFailure;
3131

src/Framework/MockObject/Generator/Generator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ final class Generator
103103
* @throws RuntimeException
104104
* @throws UnknownTypeException
105105
*/
106-
public function testDouble(string $type, bool $mockObject, ?array $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false, object $proxyTarget = null, bool $allowMockingUnknownTypes = true, bool $returnValueGeneration = true): MockObject|Stub
106+
public function testDouble(string $type, bool $mockObject, ?array $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false, ?object $proxyTarget = null, bool $allowMockingUnknownTypes = true, bool $returnValueGeneration = true): MockObject|Stub
107107
{
108108
if ($type === Traversable::class) {
109109
$type = Iterator::class;
@@ -234,7 +234,7 @@ public function testDoubleForInterfaceIntersection(array $interfaces, bool $mock
234234
*
235235
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5241
236236
*/
237-
public function mockObjectForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject
237+
public function mockObjectForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, ?array $mockedMethods = null, bool $cloneArguments = true): MockObject
238238
{
239239
if (class_exists($originalClassName, $callAutoload) ||
240240
interface_exists($originalClassName, $callAutoload)) {
@@ -295,7 +295,7 @@ interface_exists($originalClassName, $callAutoload)) {
295295
*
296296
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5243
297297
*/
298-
public function mockObjectForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject
298+
public function mockObjectForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, ?array $mockedMethods = null, bool $cloneArguments = true): MockObject
299299
{
300300
if (!trait_exists($traitName, $callAutoload)) {
301301
throw new UnknownTraitException($traitName);
@@ -378,7 +378,7 @@ public function objectForTrait(string $traitName, string $traitClassName = '', b
378378
*
379379
* @see https://github.com/sebastianbergmann/phpunit/issues/5476
380380
*/
381-
public function generate(string $type, bool $mockObject, array $methods = null, string $mockClassName = '', bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false): MockClass
381+
public function generate(string $type, bool $mockObject, ?array $methods = null, string $mockClassName = '', bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false): MockClass
382382
{
383383
if ($mockClassName !== '') {
384384
return $this->generateCodeForTestDoubleClass(
@@ -561,7 +561,7 @@ private function userDefinedInterfaceMethods(string $interfaceName): array
561561
* @throws ReflectionException
562562
* @throws RuntimeException
563563
*/
564-
private function getObject(MockType $mockClass, string $type = '', bool $callOriginalConstructor = false, array $arguments = [], bool $callOriginalMethods = false, object $proxyTarget = null, bool $returnValueGeneration = true): object
564+
private function getObject(MockType $mockClass, string $type = '', bool $callOriginalConstructor = false, array $arguments = [], bool $callOriginalMethods = false, ?object $proxyTarget = null, bool $returnValueGeneration = true): object
565565
{
566566
$className = $mockClass->generate();
567567
$object = $this->instantiate($className, $callOriginalConstructor, $arguments);

src/Runner/PhptTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test
8484
*
8585
* @throws Exception
8686
*/
87-
public function __construct(string $filename, AbstractPhpProcess $phpUtil = null)
87+
public function __construct(string $filename, ?AbstractPhpProcess $phpUtil = null)
8888
{
8989
if (!is_file($filename)) {
9090
throw new FileDoesNotExistException($filename);

src/Util/Exporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static function export(mixed $value, bool $exportObjects = false): string
2929
return '{enable export of objects to see this value}';
3030
}
3131

32-
private static function isExportable(mixed &$value, Context $context = null): bool
32+
private static function isExportable(mixed &$value, ?Context $context = null): bool
3333
{
3434
if (is_scalar($value) || $value === null) {
3535
return true;

src/Util/PHP/AbstractPhpProcess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function runTestJob(string $job, Test $test, string $processResultFile):
157157
/**
158158
* Returns the command based into the configurations.
159159
*/
160-
public function getCommand(array $settings, string $file = null): string
160+
public function getCommand(array $settings, ?string $file = null): string
161161
{
162162
$runtime = new Runtime;
163163

0 commit comments

Comments
 (0)