Skip to content

Commit

Permalink
Merge pull request #326 from Yoast/JRF/yoastcs-docs-improve-test-retu…
Browse files Browse the repository at this point in the history
…rn-tags

Docs: improve test `@return` tags
  • Loading branch information
jrfnl authored Nov 4, 2023
2 parents bb16cf2 + bf62ed1 commit b0964f2
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class CodeCoverageIgnoreDeprecatedUnitTest extends AbstractSniffUnitTest {
/**
* Returns the lines where errors should occur.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList(): array {
return [
Expand All @@ -31,7 +31,7 @@ public function getErrorList(): array {
/**
* Returns the lines where warnings should occur.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList(): array {
return [];
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/Commenting/CoversTagUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class CoversTagUnitTest extends AbstractSniffUnitTest {
/**
* Returns the lines where errors should occur.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList(): array {
return [
Expand Down Expand Up @@ -52,7 +52,7 @@ public function getErrorList(): array {
/**
* Returns the lines where warnings should occur.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList(): array {
return [];
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/Commenting/FileCommentUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class FileCommentUnitTest extends AbstractSniffUnitTest {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList( string $testFile = '' ): array {
switch ( $testFile ) {
Expand All @@ -40,7 +40,7 @@ public function getErrorList( string $testFile = '' ): array {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList( string $testFile = '' ): array {
switch ( $testFile ) {
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/Commenting/TestsHaveCoversTagUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class TestsHaveCoversTagUnitTest extends AbstractSniffUnitTest {
/**
* Returns the lines where errors should occur.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList(): array {
return [
Expand All @@ -32,7 +32,7 @@ public function getErrorList(): array {
/**
* Returns the lines where warnings should occur.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList(): array {
return [];
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/Files/FileNameUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected function getTestFiles( $testFileBase ): array {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList( string $testFile = '' ): array {

Expand All @@ -134,7 +134,7 @@ public function getErrorList( string $testFile = '' ): array {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList( string $testFile = '' ): array {
if ( $testFile === 'no-basepath.inc' ) {
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/Files/TestDoublesUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function getTestFiles( $testFileBase ): array {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList( string $testFile = '' ): array {

Expand Down Expand Up @@ -132,7 +132,7 @@ public function getErrorList( string $testFile = '' ): array {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList( string $testFile = '' ): array {
switch ( $testFile ) {
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/NamingConventions/NamespaceNameUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function getTestFiles( $testFileBase ): array {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList( string $testFile = '' ): array {

Expand Down Expand Up @@ -171,7 +171,7 @@ public function getErrorList( string $testFile = '' ): array {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList( string $testFile = '' ): array {
switch ( $testFile ) {
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/NamingConventions/ObjectNameDepthUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class ObjectNameDepthUnitTest extends AbstractSniffUnitTest {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList( string $testFile = '' ): array {

Expand Down Expand Up @@ -54,7 +54,7 @@ public function getErrorList( string $testFile = '' ): array {
*
* @param string $testFile The name of the file being tested.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList( string $testFile = '' ): array {
switch ( $testFile ) {
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/NamingConventions/ValidHookNameUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function setCliValues( $filename, $config ): void {
/**
* Returns the lines where errors should occur.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList(): array {

Expand All @@ -56,7 +56,7 @@ public function getErrorList(): array {
/**
* Returns the lines where warnings should occur.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList(): array {
return [
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/Tools/BrainMonkeyRaceConditionUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class BrainMonkeyRaceConditionUnitTest extends AbstractSniffUnitTest {
/**
* Returns the lines where errors should occur.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList(): array {
return [
Expand All @@ -30,7 +30,7 @@ public function getErrorList(): array {
/**
* Returns the lines where warnings should occur.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList(): array {
return [];
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/WhiteSpace/FunctionSpacingUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class FunctionSpacingUnitTest extends AbstractSniffUnitTest {
/**
* Returns the lines where errors should occur.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList(): array {
return [
Expand All @@ -36,7 +36,7 @@ public function getErrorList(): array {
/**
* Returns the lines where warnings should occur.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList(): array {
return [];
Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/Yoast/AlternativeFunctionsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class AlternativeFunctionsUnitTest extends AbstractSniffUnitTest {
/**
* Returns the lines where errors should occur.
*
* @return array <int line number> => <int number of errors>
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList(): array {
return [
Expand All @@ -33,7 +33,7 @@ public function getErrorList(): array {
/**
* Returns the lines where warnings should occur.
*
* @return array <int line number> => <int number of warnings>
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList(): array {
return [];
Expand Down

0 comments on commit b0964f2

Please sign in to comment.