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 type declarations #189

Merged
merged 1 commit into from
Dec 26, 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
2 changes: 1 addition & 1 deletion src/Sniffs/AbstractArraySniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class AbstractArraySniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
final public function register()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sniffs/AbstractPatternSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct($ignoreComments=null)
* Classes extending <i>AbstractPatternTest</i> should implement the
* <i>getPatterns()</i> method to register the patterns they wish to test.
*
* @return int[]
* @return array<int|string>
* @see process()
*/
final public function register()
Expand Down
2 changes: 1 addition & 1 deletion src/Sniffs/AbstractScopeSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function __construct(
* DO NOT OVERRIDE THIS METHOD. Use the constructor of this class to register
* for the desired tokens and scope.
*
* @return int[]
* @return array<int|string>
* @see __constructor()
*/
final public function register()
Expand Down
10 changes: 5 additions & 5 deletions src/Sniffs/Sniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ interface Sniff
*
* <code>
* return array(
* T_WHITESPACE,
* T_DOC_COMMENT,
* T_COMMENT,
* );
* T_WHITESPACE,
* T_DOC_COMMENT,
* T_COMMENT,
* );
* </code>
*
* @return mixed[]
* @return array<int|string>
* @see Tokens.php
*/
public function register();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DisallowLongArraySyntaxSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DuplicateClassNameSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class OpeningBraceSameLineSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AssignmentInConditionSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EmptyPHPStatementSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class EmptyStatementSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ForLoopShouldBeWhileLoopSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ForLoopWithTestFunctionCallSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class JumbledIncrementerSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class UnconditionalIfStatementSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UnnecessaryFinalModifierSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class UnusedFunctionParameterSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UselessOverridingMethodSniff implements Sniff
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DocCommentSniff 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 src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FixmeSniff 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 src/Standards/Generic/Sniffs/Commenting/TodoSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TodoSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DisallowYodaConditionsSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class InlineControlStructureSniff 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 src/Standards/Generic/Sniffs/Debug/CSSLintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CSSLintSniff implements Sniff
/**
* Returns the token types that this sniff is interested in.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ClosureLinterSniff implements Sniff
/**
* Returns the token types that this sniff is interested in.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Standards/Generic/Sniffs/Debug/ESLintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ESLintSniff implements Sniff
/**
* Returns the token types that this sniff is interested in.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Standards/Generic/Sniffs/Debug/JSHintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class JSHintSniff implements Sniff
/**
* Returns the token types that this sniff is interested in.
*
* @return int[]
* @return array<int|string>
*/
public function register()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ByteOrderMarkSniff 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 src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class EndFileNewlineSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class EndFileNoNewlineSniff 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 src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ExecutableFileSniff 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 src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class InlineHTMLSniff 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 src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LineEndingsSniff 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 src/Standards/Generic/Sniffs/Files/LineLengthSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class LineLengthSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LowercasedFilenameSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class OneClassPerFileSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class OneInterfacePerFileSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class OneObjectStructurePerFileSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class OneTraitPerFileSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DisallowMultipleStatementsSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class MultipleStatementAlignmentSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class NoSpaceAfterCastSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SpaceAfterCastSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SpaceAfterNotSniff implements Sniff
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
* @return array<int|string>
*/
public function register()
{
Expand Down
Loading
Loading