Skip to content

Commit 4d72ca7

Browse files
authored
Merge pull request #152 from PHPCSStandards/docs/split-some-throws-tags
Docs: one `@throws` per exception thrown
2 parents 49d7716 + d7f8d50 commit 4d72ca7

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

PHPCSUtils/Utils/ControlStructures.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,10 @@ public static function getDeclareScopeOpenClose(File $phpcsFile, $stackPtr)
363363
*
364364
* @return array
365365
*
366-
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified $stackPtr is not of
367-
* type T_CATCH, doesn't exist or in case
368-
* of a parse error.
366+
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified `$stackPtr` is not of
367+
* type `T_CATCH` or doesn't exist.
368+
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If no parenthesis opener or closer can be
369+
* determined (parse error).
369370
*/
370371
public static function getCaughtExceptions(File $phpcsFile, $stackPtr)
371372
{

PHPCSUtils/Utils/TextStrings.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ class TextStrings
4646
* @return string The complete text string.
4747
*
4848
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
49-
* valid text string token or if the
50-
* token is not the first text string token.
49+
* valid text string token.
50+
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not the _first_
51+
* token in a text string.
5152
*/
5253
public static function getCompleteTextString(File $phpcsFile, $stackPtr, $stripQuotes = true)
5354
{

PHPCSUtils/Utils/UseStatements.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ public static function isTraitUse(File $phpcsFile, $stackPtr)
169169
* ]`
170170
*
171171
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
172-
* T_USE token or not an import use statement.
172+
* `T_USE` token.
173+
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the `T_USE` token is not for an import
174+
* use statement.
173175
*/
174176
public static function splitImportUseStatement(File $phpcsFile, $stackPtr)
175177
{

PHPCSUtils/Utils/Variables.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ class Variables
109109
* @return array
110110
*
111111
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
112-
* T_VARIABLE token, or if the position is not
113-
* a class member variable.
112+
* T_VARIABLE token.
113+
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
114+
* class member variable.
114115
*/
115116
public static function getMemberProperties(File $phpcsFile, $stackPtr)
116117
{

0 commit comments

Comments
 (0)