You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: yCodeTech/Docs/Commenting/FunctionCommentStandard.xml
+5-9Lines changed: 5 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
1
<documentationtitle="Function Comment">
2
2
<standard>
3
3
<![CDATA[
4
-
Non-void returning functions must have a @return docblock tag.
4
+
Functions that return a value must have a `@return` docblock tag.
5
5
6
6
This rule enforces:
7
7
8
-
1. Functions with non-void return types (string, bool, etc.) must have a `@return` tag.
9
-
2. Functions with void return types must NOT have `@return` tags, except generator functions.
10
-
3. Generator functions must have a `@return` tag with type iterable.
8
+
1. Functions with `non-void` return types (`string`, `bool`, etc.) must have a `@return` tag.
9
+
2. Functions with `void` return types must NOT have `@return` tags, except generator functions.
10
+
3. Generator functions must have a `@return` tag.
11
11
12
12
Notes:
13
13
14
14
- Both typed and untyped functions are checked.
15
15
- Return types can be declared or inferred from function signature.
16
-
- Magic methods (e.g. __construct, __get, etc.) are exempt from requiring @return tags.
16
+
- Magic methods (e.g. `__construct`, `__get`, etc.) are exempt from requiring `@return` tags.
17
17
- Fixing `@return` tags will have the type `mixed`, and generator functions will have the type `iterable`; these should then be edited manually to specific types.
18
18
19
19
---
@@ -32,7 +32,6 @@
32
32
*/
33
33
public function formatString(string $input): string
34
34
{
35
-
return strtoupper($input);
36
35
}
37
36
]]>
38
37
</code>
@@ -45,7 +44,6 @@ public function formatString(string $input): string
45
44
</em> */
46
45
public function formatString(string $input): string
47
46
{
48
-
return strtoupper($input);
49
47
}
50
48
]]>
51
49
</code>
@@ -61,7 +59,6 @@ public function formatString(string $input): string
61
59
</em> */
62
60
public function processData(array $data): void
63
61
{
64
-
// Process data
65
62
}
66
63
]]>
67
64
</code>
@@ -76,7 +73,6 @@ public function processData(array $data): void
Copy file name to clipboardExpand all lines: yCodeTech/Docs/Types/DisallowTypeLongNamesStandard.xml
+5-11Lines changed: 5 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
Applies to:
12
12
13
13
1. Regular docblock tags that contain types (`@param`, `@return`, `@var`, `@property`, `@method`) and any others that contain these regular tags (`@property-read`, `@property-write`, `@phpstan-*`, `@psalm-*`, etc.)
0 commit comments