Skip to content

Normalize and fix phpdoc typehints across the code #3256

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1540,9 +1540,9 @@ public static function getExecutablePath($name)
* @param string|null $value The value to set. If null, the config
* entry is deleted, reverting it to the
* default value.
* @param boolean $temp Set this config data temporarily for this
* script run. This will not write the config
* data to the config file.
* @param bool $temp Set this config data temporarily for this
* script run. This will not write the
* config data to the config file.
*
* @return bool
* @see getConfigData()
Expand Down
69 changes: 36 additions & 33 deletions src/Files/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,15 +643,16 @@ public function cleanUp()
/**
* Records an error against a specific token in the file.
*
* @param string $error The error message.
* @param int $stackPtr The stack position where the error occurred.
* @param string $code A violation code unique to the sniff message.
* @param array $data Replacements for the error message.
* @param int $severity The severity level for this error. A value of 0
* will be converted into the default severity level.
* @param boolean $fixable Can the error be fixed by the sniff?
* @param string $error The error message.
* @param int $stackPtr The stack position where the error occurred.
* @param string $code A violation code unique to the sniff message.
* @param array $data Replacements for the error message.
* @param int $severity The severity level for this error. A value of 0
* will be converted into the default severity
* level.
* @param bool $fixable Can the error be fixed by the sniff?
*
* @return boolean
* @return bool
*/
public function addError(
$error,
Expand All @@ -677,15 +678,16 @@ public function addError(
/**
* Records a warning against a specific token in the file.
*
* @param string $warning The error message.
* @param int $stackPtr The stack position where the error occurred.
* @param string $code A violation code unique to the sniff message.
* @param array $data Replacements for the warning message.
* @param int $severity The severity level for this warning. A value of 0
* will be converted into the default severity level.
* @param boolean $fixable Can the warning be fixed by the sniff?
* @param string $warning The error message.
* @param int $stackPtr The stack position where the error occurred.
* @param string $code A violation code unique to the sniff message.
* @param array $data Replacements for the warning message.
* @param int $severity The severity level for this warning. A value of 0
* will be converted into the default severity
* level.
* @param bool $fixable Can the warning be fixed by the sniff?
*
* @return boolean
* @return bool
*/
public function addWarning(
$warning,
Expand Down Expand Up @@ -718,7 +720,7 @@ public function addWarning(
* @param int $severity The severity level for this error. A value of 0
* will be converted into the default severity level.
*
* @return boolean
* @return bool
*/
public function addErrorOnLine(
$error,
Expand All @@ -742,7 +744,7 @@ public function addErrorOnLine(
* @param int $severity The severity level for this warning. A value of 0 will
* will be converted into the default severity level.
*
* @return boolean
* @return bool
*/
public function addWarningOnLine(
$warning,
Expand All @@ -768,7 +770,7 @@ public function addWarningOnLine(
* @param int $severity The severity level for this error. A value of 0
* will be converted into the default severity level.
*
* @return boolean
* @return bool
*/
public function addFixableError(
$error,
Expand Down Expand Up @@ -799,7 +801,7 @@ public function addFixableError(
* @param int $severity The severity level for this warning. A value of 0
* will be converted into the default severity level.
*
* @return boolean
* @return bool
*/
public function addFixableWarning(
$warning,
Expand All @@ -821,17 +823,18 @@ public function addFixableWarning(
/**
* Adds an error to the error stack.
*
* @param boolean $error Is this an error message?
* @param string $message The text of the message.
* @param int $line The line on which the message occurred.
* @param int $column The column at which the message occurred.
* @param string $code A violation code unique to the sniff message.
* @param array $data Replacements for the message.
* @param int $severity The severity level for this message. A value of 0
* will be converted into the default severity level.
* @param boolean $fixable Can the problem be fixed by the sniff?
* @param bool $error Is this an error message?
* @param string $message The text of the message.
* @param int $line The line on which the message occurred.
* @param int $column The column at which the message occurred.
* @param string $code A violation code unique to the sniff message.
* @param array $data Replacements for the message.
* @param int $severity The severity level for this message. A value of 0
* will be converted into the default severity
* level.
* @param bool $fixable Can the problem be fixed by the sniff?
*
* @return boolean
* @return bool
*/
protected function addMessage($error, $message, $line, $column, $code, $data, $severity, $fixable)
{
Expand Down Expand Up @@ -1093,7 +1096,7 @@ protected function addMessage($error, $message, $line, $column, $code, $data, $s
* @param string $metric The name of the metric being recorded.
* @param string $value The value of the metric being recorded.
*
* @return boolean
* @return bool
*/
public function recordMetric($stackPtr, $metric, $value)
{
Expand Down Expand Up @@ -1965,7 +1968,7 @@ public function getClassProperties($stackPtr)
*
* @param int $stackPtr The position of the T_BITWISE_AND token.
*
* @return boolean
* @return bool
*/
public function isReference($stackPtr)
{
Expand Down Expand Up @@ -2497,7 +2500,7 @@ public function findFirstOnLine($types, $start, $exclude=false, $value=null)
* @param int $stackPtr The position of the token we are checking.
* @param int|string|array $types The type(s) of tokens to search for.
*
* @return boolean
* @return bool
*/
public function hasCondition($stackPtr, $types)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Files/FileList.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function next()
/**
* Checks if current position is valid.
*
* @return boolean
* @return bool
*/
public function valid()
{
Expand All @@ -236,7 +236,7 @@ public function valid()
/**
* Return the number of files in the list.
*
* @return integer
* @return int
*/
public function count()
{
Expand Down
12 changes: 6 additions & 6 deletions src/Fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function startFile(File $phpcsFile)
/**
* Attempt to fix the file by processing it until no fixes are made.
*
* @return boolean
* @return bool
*/
public function fixFile()
{
Expand Down Expand Up @@ -217,10 +217,10 @@ public function fixFile()
/**
* Generates a text diff of the original file and the new content.
*
* @param string $filePath Optional file path to diff the file against.
* If not specified, the original version of the
* file will be used.
* @param boolean $colors Print coloured output or not.
* @param string $filePath Optional file path to diff the file against.
* If not specified, the original version of
* the file will be used.
* @param bool $colors Print coloured output or not.
*
* @return string
*/
Expand Down Expand Up @@ -374,7 +374,7 @@ public function beginChangeset()
/**
* Stop recording actions for a changeset, and apply logged changes.
*
* @return boolean
* @return bool
*/
public function endChangeset()
{
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Cbf.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class Cbf implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
* @throws \PHP_CodeSniffer\Exceptions\DeepExitException
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Checkstyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class Checkstyle implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Code.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class Code implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class Csv implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class Diff implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Emacs.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class Emacs implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Full.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class Full implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class Info implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class Json implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Junit.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class Junit implements Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Notifysend.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public function __construct()
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Reports/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ interface Report
* and FALSE if it ignored the file. Returning TRUE indicates that the file and
* its data should be counted in the grand totals.
*
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
* @param array $report Prepared report data.
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being reported on.
* @param bool $showSources Show sources?
* @param int $width Maximum allowed line width.
*
* @return bool
*/
Expand Down
Loading