Skip to content

Commit 7b7ae77

Browse files
author
Florian Krämer
committed
Updating doc blocks
1 parent 6b72761 commit 7b7ae77

9 files changed

+34
-18
lines changed

src/Architecture/CatchExceptionOfTypeNotAllowedRule.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
use PHPStan\Rules\RuleErrorBuilder;
1212

1313
/**
14+
* Specification:
15+
*
16+
* - Checks if a caught exception type is in the forbidden list.
17+
* - Reports an error if a forbidden exception type is caught.
18+
*
1419
* @implements Rule<Catch_>
1520
*/
1621
class CatchExceptionOfTypeNotAllowedRule implements Rule

src/Architecture/ClassMustBeFinalRule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
/**
1515
* Specification:
16+
*
1617
* - Checks if a class matches a given regex pattern.
1718
* - Checks if the class is declared as final.
1819
*

src/Architecture/ClassMustBeReadonlyRule.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313
/**
1414
* Specification:
15+
*
16+
* - Checks if a class matches a given regex pattern.
1517
* - A matching class must be declared as readonly.
18+
*
1619
* @implements Rule<Class_>
1720
*/
1821
class ClassMustBeReadonlyRule implements Rule

src/Architecture/ClassnameMustMatchPatternRule.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
/**
1616
* Specification:
17-
* PHPStan rule to ensure that classes inside namespaces matching a given regex
18-
* must have names matching at least one of the provided patterns.
17+
*
18+
* - Checks if a namespace matches a given regex pattern.
19+
* - Ensures that classes inside matching namespaces have names matching at least one of the provided patterns.
1920
*
2021
* @implements Rule<Namespace_>
2122
*/

src/Architecture/DependencyConstraintsRule.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@
1313
use PHPStan\ShouldNotHappenException;
1414

1515
/**
16-
* A PHPStan rule to enforce dependency constraints between namespaces.
16+
* Specification:
1717
*
18-
* This rule checks the `use` statements in your PHP code and ensures that
19-
* certain namespaces do not depend on other namespaces as specified in the
20-
* configuration.
18+
* - Checks use statements in PHP code.
19+
* - A class in a namespace matching a given regex is not allowed to depend on any namespace defined by a set of other regexes.
20+
* - Reports an error if a forbidden dependency is detected.
2121
*
22-
* Specification:
23-
* - A class in a namespace matching a given regex is not allowed to depend on any namespace defined by a set of
24-
* other regexes.
22+
* @implements Rule<Use_>
2523
*/
2624
class DependencyConstraintsRule implements Rule
2725
{

src/Architecture/ForbiddenNamespacesRule.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@
1212
use PHPStan\ShouldNotHappenException;
1313

1414
/**
15-
* A PHPStan rule to enforce that certain namespaces can not be declared.
16-
*
17-
* This rule checks the `namespace` keyword in your PHP code and ensures that
18-
* certain namespaces can not be declared as specified in the configuration,
19-
* to enforce architectural constraints.
20-
*
2115
* Specification:
16+
*
17+
* - Checks namespace declarations in PHP code.
2218
* - A (sub) namespace matching a given regex is not allowed to be declared.
19+
* - Reports an error if a forbidden namespace is declared.
2320
*
2421
* @implements Rule<Namespace_>
2522
*/

src/CleanCode/ControlStructureNestingRule.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
use PHPStan\ShouldNotHappenException;
1919

2020
/**
21-
* A rule to check the nesting level of control structures (if, else, elseif, try, catch).
21+
* Specification:
22+
*
23+
* - Checks the nesting level of control structures (if, else, elseif, try, catch).
24+
* - Reports an error if the nesting level exceeds the configured maximum.
2225
*
2326
* @implements Rule<Node>
2427
*/

src/CleanCode/MaxLineLengthRule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
use PHPStan\ShouldNotHappenException;
1414

1515
/**
16-
* A configurable rule to check the maximum line length.
16+
* Specification:
17+
*
18+
* - Checks if a line exceeds the configured maximum line length.
19+
* - Optionally excludes files matching specific patterns.
20+
* - Optionally ignores use statements.
1721
*
1822
* @implements Rule<Node>
1923
*/

src/CleanCode/TooManyArgumentsRule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
use PHPStan\ShouldNotHappenException;
1414

1515
/**
16-
* A configurable rule to check the number of arguments in a method.
16+
* Specification:
17+
*
18+
* - Checks if a method has more arguments than the configured maximum.
19+
* - Optionally applies only to classes matching specific patterns.
20+
* - Reports an error if the number of arguments exceeds the configured maximum.
1721
*
1822
* @implements Rule<ClassMethod>
1923
*/

0 commit comments

Comments
 (0)