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 23, 2023
1 parent 7d83656 commit a3f1bea
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/WPIntegration/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class Autoload {
/**
* A list of the classes this autoloader handles.
*
* @var string[] => true
* @var array<string, true>
*/
private static $supported_classes = [
'PHPUnit\\Framework\\MockObject\\Builder\\NamespaceMatch' => true,
Expand Down
4 changes: 2 additions & 2 deletions tests/BrainMonkey/TestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function testMakeDoubleForUnavailableClass( $class_name ) {
/**
* Data provider.
*
* @return array
* @return array<string, array<string>>
*/
public function dataMakeDoubleForUnavailableClass() {
return [
Expand Down Expand Up @@ -218,7 +218,7 @@ public function testMakeDoubleForUnavailableClassThrowsExceptionWithInvalidName(
/**
* Data provider.
*
* @return array
* @return array<string, array<string>>
*/
public function dataMakeDoubleForUnavailableClassThrowsExceptionWithInvalidName() {
return [
Expand Down
22 changes: 11 additions & 11 deletions tests/BrainMonkey/YoastTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testStubGetBlogInfo( $show, $expected ) {
/**
* Data provider.
*
* @return array
* @return array<string, array<string, string>>
*/
public function dataStubGetBlogInfo() {
return [
Expand Down Expand Up @@ -125,9 +125,9 @@ public function testStubWpKsesPost() {
*
* @dataProvider dataStubWpParseArgs
*
* @param array $settings Value for settings to pass to the function.
* @param array $defaults Value for defaults to pass to the function.
* @param array $expected Expected return value.
* @param array<string, mixed> $settings Value for settings to pass to the function.
* @param array<string, mixed> $defaults Value for defaults to pass to the function.
* @param array<string, mixed> $expected Expected return value.
*
* @return void
*/
Expand All @@ -138,7 +138,7 @@ public function testStubWpParseArgs( $settings, $defaults, $expected ) {
/**
* Data provider.
*
* @return array
* @return array<string, array<string, array<string, mixed>>>
*/
public function dataStubWpParseArgs() {
return [
Expand Down Expand Up @@ -219,7 +219,7 @@ public function testStubWpStripAllTags( $text, $remove_breaks, $expected ) {
/**
* Data provider.
*
* @return array
* @return array<string, array<string, string|bool>>
*/
public function dataStubWpStripAllTags() {
return [
Expand Down Expand Up @@ -271,7 +271,7 @@ public function dataStubWpStripAllTags() {
*
* @dataProvider dataStubWpSlash
*
* @param string $input Value to pass to the function.
* @param mixed $input Value to pass to the function.
*
* @return void
*/
Expand All @@ -282,7 +282,7 @@ public function testStubWpSlash( $input ) {
/**
* Data provider.
*
* @return array
* @return array<string, array<string, mixed>>
*/
public function dataStubWpSlash() {
return [
Expand All @@ -308,8 +308,8 @@ public function dataStubWpSlash() {
*
* @dataProvider dataStubWpUnslash
*
* @param string $input Value to pass to the function.
* @param string $expected Expected return value.
* @param mixed $input Value to pass to the function.
* @param mixed $expected Expected return value.
*
* @return void
*/
Expand All @@ -320,7 +320,7 @@ public function testStubWpUnslash( $input, $expected ) {
/**
* Data provider.
*
* @return array
* @return array<string, array<string, mixed>>
*/
public function dataStubWpUnslash() {
return [
Expand Down
4 changes: 2 additions & 2 deletions tests/Helpers/ExpectOutputHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function testMatchingSubstringsWithMismatchedLineEndingsAmount( $expected
/**
* Data provider.
*
* @return array
* @return array<array<string>>
*/
public function dataMatchingSubstringsMismatchedLineEndings() {
return [
Expand Down Expand Up @@ -231,7 +231,7 @@ public function testNormalizeLineEndings( $input, $expected ) {
/**
* Data provider for the `testNormalizeLineEndings()` test.
*
* @return array
* @return array<string, array<string>>
*/
public function dataNormalizeLineEndings() {
return [
Expand Down

0 comments on commit a3f1bea

Please sign in to comment.