Skip to content

Commit

Permalink
Docs: improve type specificity
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Sep 9, 2024
1 parent 12877d9 commit 684db66
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions PHPCSDebug/Sniffs/Debug/TokenListSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TokenListSniff implements Sniff
/**
* A list of tokenizers this sniff supports.
*
* @var array
* @var array<string>
*/
public $supportedTokenizers = [
'PHP',
Expand All @@ -41,7 +41,7 @@ class TokenListSniff implements Sniff
*
* This prevents issues with "undefined index" notices in case of rare tokenizer issues.
*
* @var array
* @var array<string, int|string|array<int, int|string>>
*/
private $tokenDefaults = [
'type' => '?',
Expand All @@ -57,7 +57,7 @@ class TokenListSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
2 changes: 1 addition & 1 deletion PHPCSDebug/Tests/Debug/TokenListCssTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class TokenListCssTest extends UtilityMethodTestCase
/**
* Set the name of a sniff to pass to PHPCS to limit the run (and force it to record errors).
*
* @var array
* @var array<string>
*/
protected static $selectedSniff = ['PHPCSDebug.Debug.TokenList'];

Expand Down
2 changes: 1 addition & 1 deletion PHPCSDebug/Tests/Debug/TokenListJsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class TokenListJsTest extends UtilityMethodTestCase
/**
* Set the name of a sniff to pass to PHPCS to limit the run (and force it to record errors).
*
* @var array
* @var array<string>
*/
protected static $selectedSniff = ['PHPCSDebug.Debug.TokenList'];

Expand Down
2 changes: 1 addition & 1 deletion PHPCSDebug/Tests/Debug/TokenListUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class TokenListUnitTest extends UtilityMethodTestCase
/**
* Set the name of a sniff to pass to PHPCS to limit the run (and force it to record errors).
*
* @var array
* @var array<string>
*/
protected static $selectedSniff = ['PHPCSDebug.Debug.TokenList'];

Expand Down
14 changes: 7 additions & 7 deletions Scripts/CheckSniffCompleteness.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CheckSniffCompleteness
/**
* The target directories to examine.
*
* @var array
* @var array<string>
*/
protected $targetDirs = [];

Expand All @@ -80,7 +80,7 @@ class CheckSniffCompleteness
/**
* Directories to exclude from the scan.
*
* @var array
* @var array<string>
*/
protected $excludedDirs = [
'vendor',
Expand All @@ -89,14 +89,14 @@ class CheckSniffCompleteness
/**
* List of all files in the repo.
*
* @var array
* @var array<string, int> Key is a file name, value irrelevant.
*/
protected $allFiles = [];

/**
* List of all sniff files in the repo.
*
* @var array
* @var array<string>
*/
protected $allSniffs = [];

Expand All @@ -105,7 +105,7 @@ class CheckSniffCompleteness
*
* Keys are the strings to search for, values the replacement values.
*
* @var array
* @var array<string, string>
*/
private $sniffToDoc = [
'/Sniffs/' => '/Docs/',
Expand All @@ -117,7 +117,7 @@ class CheckSniffCompleteness
*
* Keys are the strings to search for, values the replacement values.
*
* @var array
* @var array<string, string>
*/
private $sniffToUnitTest = [
'/Sniffs/' => '/Tests/',
Expand All @@ -127,7 +127,7 @@ class CheckSniffCompleteness
/**
* Possible test case file extensions.
*
* @var array
* @var array<string>
*/
private $testCaseExtensions = [
'.inc',
Expand Down
2 changes: 1 addition & 1 deletion Scripts/FileList.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function getIterator()
/**
* Retrieve the filtered file list as an array.
*
* @return array
* @return array<string>
*/
public function getList()
{
Expand Down
4 changes: 2 additions & 2 deletions Tests/DocsXsd/DocsXsdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testXsdValidationPassedWithValidXml($fixtureFile)
/**
* Data provider for valid test cases.
*
* @return array
* @return array<string, array<string, string>>
*/
public function dataValidXsd()
{
Expand Down Expand Up @@ -108,7 +108,7 @@ public function testXsdValidationFailsForInvalidXml($fixtureFile, $expectedStdOu
/**
* Data provider for invalid test cases.
*
* @return array
* @return array<string, array<string, string>>
*/
public function dataInvalidXsd()
{
Expand Down
8 changes: 4 additions & 4 deletions Tests/IOTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ abstract class IOTestCase extends XTestCase
* Note: if the command itself already contains a "working directory" argument,
* this parameter will normally not need to be passed.
*
* @return array Format:
* 'exitcode' int The exit code from the command.
* 'stdout' string The output send to stdout.
* 'stderr' string The output send to stderr.
* @return array<string, int|string> Format:
* 'exitcode' int The exit code from the command.
* 'stdout' string The output send to stdout.
* 'stderr' string The output send to stderr.
*
* @throws \RuntimeException When the passed arguments do not comply.
* @throws \RuntimeException When no resource could be obtained to execute the command.
Expand Down

0 comments on commit 684db66

Please sign in to comment.