Skip to content

Commit 459f971

Browse files
committed
PEAR/FunctionCallSignature: add tests with the PHP 8 identifier tokens
... to make sure that function calls using the new tokens are handled correctly by the sniff.
1 parent 24c5688 commit 459f971

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,3 +574,17 @@ content
574574
'my_file.php'
575575
); ?>
576576
<?php endif; ?>
577+
578+
<?php
579+
$val = \functionCall ( $arg );
580+
$val = Package\functionCall( $arg );
581+
$val = namespace\functionCall ($arg);
582+
583+
$val = \functionCall ( $arg
584+
, $arg2 );
585+
$val = Package\functionCall(
586+
$arg, $arg2);
587+
$val = namespace\functionCall(
588+
$arg,
589+
$arg2
590+
);

src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,3 +589,20 @@ content
589589
'my_file.php'
590590
); ?>
591591
<?php endif; ?>
592+
593+
<?php
594+
$val = \functionCall($arg);
595+
$val = Package\functionCall($arg);
596+
$val = namespace\functionCall($arg);
597+
598+
$val = \functionCall(
599+
$arg
600+
, $arg2
601+
);
602+
$val = Package\functionCall(
603+
$arg, $arg2
604+
);
605+
$val = namespace\functionCall(
606+
$arg,
607+
$arg2
608+
);

src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ public function getErrorList()
116116
568 => 1,
117117
573 => 1,
118118
574 => 1,
119+
579 => 3,
120+
580 => 2,
121+
581 => 1,
122+
583 => 2,
123+
584 => 1,
124+
586 => 2,
119125
];
120126

121127
}//end getErrorList()

0 commit comments

Comments
 (0)