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 10, 2024
1 parent 681125d commit 373aa4e
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Scripts/FeatureComplete/Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ final class Check
/**
* List of all docs files in the repo.
*
* @var array
* @var array<string>
*/
protected $allDocs = [];

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

Expand Down
2 changes: 1 addition & 1 deletion Scripts/FeatureComplete/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ final class Config
/**
* Help texts.
*
* @var array
* @var array<string, array<array<string, string>>>
*/
private $helpTexts = [
// phpcs:disable Generic.Files.LineLength.TooLong
Expand Down
2 changes: 1 addition & 1 deletion Tests/FeatureComplete/Check/ColorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testColors($fixtureDir, $expectedOutput, $exitCode, $src = 'stdo
/**
* Data provider.
*
* @return array
* @return array<string, array<string, string|int>>
*/
public function dataColors()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/FeatureComplete/Check/MarkProgressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testProgress($nrOfFiles, $expectedOutput)
/**
* Data provider.
*
* @return array
* @return array<string, array<string, int|string>>
*/
public function dataProgress()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/FeatureComplete/Check/NoSniffsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function testTargetDoesntContainSniffs($fixtureDir)
/**
* Data provider.
*
* @return array
* @return array<string, array<string>>
*/
public function dataTargetDoesntContainSniffs()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/FeatureComplete/Check/ValidStandardsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testFeatureCompleteStandard($fixtureDir, $testDocCount)
/**
* Data provider.
*
* @return array
* @return array<string, array<string, string|int>>
*/
public function dataFeatureCompleteStandard()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/FeatureComplete/Config/GetHelpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function testShowHelpNoColors($command)
/**
* Data provider.
*
* @return array
* @return array<string, array<string, string>>
*/
public function dataShowHelp()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/FeatureComplete/Config/GetVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testShowVersion($command)
/**
* Data provider.
*
* @return array
* @return array<string, array<string, string>>
*/
public function dataShowVersion()
{
Expand Down
32 changes: 16 additions & 16 deletions Tests/FeatureComplete/Config/ProcessCliCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class ProcessCliCommandTest extends XTestCase
/**
* Relevant properties in the Config class and their default value.
*
* @var array
* @var array<string, mixed>
*/
private $defaultSettings = [
'projectRoot' => '',
Expand Down Expand Up @@ -71,7 +71,7 @@ public function testProcessCliCommandUnsupportedArgument($command)
/**
* Data provider.
*
* @return array
* @return array<string, array<string, string>>
*/
public function dataProcessCliCommandUnsupportedArgument()
{
Expand Down Expand Up @@ -107,14 +107,14 @@ public function testProcessInvalidTargetThrowException()
*
* @dataProvider dataProcessCliCommand
*
* @param string $command The command as received from the command line.
* @param array $expectedChanged The Config class properties which are expected to have been
* changed (key) with their value.
* @param bool $checkShowColored Whether to check the value of the "showColored" setting.
* This setting should only be checked when `--color` or
* `--no-color` has been explicitly passed in the $command
* as the auto-detection is not testable.
* Defaults to `false`.
* @param string $command The command as received from the command line.
* @param array<string, string|bool|int|array<string>> $expectedChanged The Config class properties which are expected to have been
* changed (key) with their value.
* @param bool $checkShowColored Whether to check the value of the "showColored" setting.
* This setting should only be checked when `--color` or
* `--no-color` has been explicitly passed in the $command
* as the auto-detection is not testable.
* Defaults to `false`.
*
* @return void
*/
Expand All @@ -139,7 +139,7 @@ public function testProcessCliCommand($command, array $expectedChanged, $checkSh
/**
* Data provider.
*
* @return array
* @return array<string, array<string, string|bool|array<string, string|bool|int|array<string>>>>
*/
public function dataProcessCliCommand()
{
Expand Down Expand Up @@ -378,9 +378,9 @@ public function dataProcessCliCommand()
*
* @dataProvider dataProcessCliCommandOutputOnlyArgs
*
* @param string $command The command as received from the command line.
* @param array $expectedChanged The Config class properties which are expected to have been
* changed (key) with their value.
* @param string $command The command as received from the command line.
* @param array<string, string|bool> $expectedChanged The Config class properties which are expected to have been
* changed (key) with their value.
*
* @return void
*/
Expand All @@ -400,7 +400,7 @@ public function testProcessCliCommandOutputOnlyArgs($command, $expectedChanged)
/**
* Data provider.
*
* @return array
* @return array<string, array<string, string|array<string, string|bool>>>
*/
public function dataProcessCliCommandOutputOnlyArgs()
{
Expand Down Expand Up @@ -447,7 +447,7 @@ public function dataProcessCliCommandOutputOnlyArgs()
*
* @param \PHPCSDevTools\Scripts\FeatureComplete\Config $config Config object
*
* @return array
* @return array<string, mixed>
*/
private function getCurrentValues(Config $config)
{
Expand Down

0 comments on commit 373aa4e

Please sign in to comment.