File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -120,3 +120,9 @@ abstract class ConstructorPropertyPromotionAbstractMethod {
120
120
// 3. The callable type is not supported for properties, but that's not the concern of this method.
121
121
abstract public function __construct (public callable $ y , private ...$ x );
122
122
}
123
+
124
+ /* testCommentsInParameter */
125
+ function commentsInParams(
126
+ // Leading comment.
127
+ ?MyClass /*-*/ & /*-*/ .../*-*/ $ param /*-*/ = /*-*/ 'default value ' . /*-*/ 'second part ' // Trailing comment.
128
+ ) {}
Original file line number Diff line number Diff line change @@ -818,6 +818,29 @@ public function testPHP8ConstructorPropertyPromotionAbstractMethod()
818
818
}//end testPHP8ConstructorPropertyPromotionAbstractMethod()
819
819
820
820
821
+ /**
822
+ * Verify and document behaviour when there are comments within a parameter declaration.
823
+ *
824
+ * @return void
825
+ */
826
+ public function testCommentsInParameter ()
827
+ {
828
+ $ expected = [];
829
+ $ expected [0 ] = [
830
+ 'name ' => '$param ' ,
831
+ 'content ' => '// Leading comment.
832
+ ?MyClass /*-*/ & /*-*/.../*-*/ $param /*-*/ = /*-*/ \'default value \' . /*-*/ \'second part \' // Trailing comment. ' ,
833
+ 'pass_by_reference ' => true ,
834
+ 'variable_length ' => true ,
835
+ 'type_hint ' => '?MyClass ' ,
836
+ 'nullable_type ' => true ,
837
+ ];
838
+
839
+ $ this ->getMethodParametersTestHelper ('/* ' .__FUNCTION__ .' */ ' , $ expected );
840
+
841
+ }//end testCommentsInParameter()
842
+
843
+
821
844
/**
822
845
* Test helper.
823
846
*
You can’t perform that action at this time.
0 commit comments