@@ -65,43 +65,41 @@ public function testOnReview($comment, $expectedStatus)
6565 }
6666
6767 /**
68- * @return array <array{string, string|null}>
68+ * @return iterable <array{string, string|null}>
6969 */
70- public static function getCommentsForStatusChange (): array
70+ public static function getCommentsForStatusChange (): iterable
7171 {
72- return [
73- ['Have a great day! ' , null ],
74- // basic tests for status change
75- ['Status: needs review ' , Status::NEEDS_REVIEW ],
76- ['Status: needs work ' , Status::NEEDS_WORK ],
77- ['Status: reviewed ' , Status::REVIEWED ],
78- // accept quotes
79- ['Status: "reviewed" ' , Status::REVIEWED ],
80- ["Status: 'reviewed' " , Status::REVIEWED ],
81- // accept trailing punctuation
82- ['Status: works for me! ' , Status::WORKS_FOR_ME ],
83- ['Status: works for me. ' , Status::WORKS_FOR_ME ],
84- // play with different formatting
85- ['STATUS: REVIEWED ' , Status::REVIEWED ],
86- ['**Status**: reviewed ' , Status::REVIEWED ],
87- ['**Status:** reviewed ' , Status::REVIEWED ],
88- ['**Status: reviewed** ' , Status::REVIEWED ],
89- ['**Status: reviewed!** ' , Status::REVIEWED ],
90- ['**Status: reviewed**. ' , Status::REVIEWED ],
91- ['Status:reviewed ' , Status::REVIEWED ],
92- ['Status: reviewed ' , Status::REVIEWED ],
93- // reject missing colon
94- ['Status reviewed ' , null ],
95- // multiple matches - use the last one
96- ["Status: needs review \r\n that is what the issue *was* marked as. \r\n Status: reviewed " , Status::REVIEWED ],
97- // "needs review" does not come directly after status: , so there is no status change
98- ['Here is my status: I \'m really happy! I realize this needs review, but I \'m, having too much fun Googling cats! ' , null ],
99- // reject if the status is not on a line of its own
100- // use case: someone posts instructions about how to change a status
101- // in a comment
102- ['You should include e.g. the line `Status: needs review` in your comment ' , null ],
103- ['Before the ticket was in state "Status: reviewed", but then the status was changed ' , null ],
104- ];
72+ yield ['Have a great day! ' , null ];
73+ // basic tests for status change
74+ yield ['Status: needs review ' , Status::NEEDS_REVIEW ];
75+ yield ['Status: needs work ' , Status::NEEDS_WORK ];
76+ yield ['Status: reviewed ' , Status::REVIEWED ];
77+ // accept quotes
78+ yield ['Status: "reviewed" ' , Status::REVIEWED ];
79+ yield ["Status: 'reviewed' " , Status::REVIEWED ];
80+ // accept trailing punctuation
81+ yield ['Status: works for me! ' , Status::WORKS_FOR_ME ];
82+ yield ['Status: works for me. ' , Status::WORKS_FOR_ME ];
83+ // play with different formatting
84+ yield ['STATUS: REVIEWED ' , Status::REVIEWED ];
85+ yield ['**Status**: reviewed ' , Status::REVIEWED ];
86+ yield ['**Status:** reviewed ' , Status::REVIEWED ];
87+ yield ['**Status: reviewed** ' , Status::REVIEWED ];
88+ yield ['**Status: reviewed!** ' , Status::REVIEWED ];
89+ yield ['**Status: reviewed**. ' , Status::REVIEWED ];
90+ yield ['Status:reviewed ' , Status::REVIEWED ];
91+ yield ['Status: reviewed ' , Status::REVIEWED ];
92+ // reject missing colon
93+ yield ['Status reviewed ' , null ];
94+ // multiple matches - use the last one
95+ yield ["Status: needs review \r\n that is what the issue *was* marked as. \r\n Status: reviewed " , Status::REVIEWED ];
96+ // "needs review" does not come directly after status: , so there is no status change
97+ yield ['Here is my status: I \'m really happy! I realize this needs review, but I \'m, having too much fun Googling cats! ' , null ];
98+ // reject if the status is not on a line of its own
99+ // use case: someone posts instructions about how to change a status
100+ // in a comment
101+ yield ['You should include e.g. the line `Status: needs review` in your comment ' , null ];
102+ yield ['Before the ticket was in state "Status: reviewed", but then the status was changed ' , null ];
105103 }
106104
107105 #[DataProviderExternal(ValidCommandProvider::class, 'get ' )]
0 commit comments