Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: improve test @return tags #326

Merged
merged 1 commit into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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