Skip to content

Commit 511affb

Browse files
nicklemgithub-actions[bot]
authored andcommitted
gpt: Automated pattern documentation updates
1 parent 2520c47 commit 511affb

File tree

5 files changed

+14985
-12181
lines changed

5 files changed

+14985
-12181
lines changed
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
Classes: Return Type Hint
1+
Enforce explicit return type hints in CakePHP classes to enhance code reliability and readability. Adopting this practice improves debugging and IDE support. For example:
2+
```php
3+
// Before
4+
public function getName() {
5+
return $this->name;
6+
}
7+
8+
// After
9+
public function getName(): string {
10+
return $this->name;
11+
}
12+
```
13+
14+
<!-- Codacy PatPatBot reviewed: 2024-05-23T16:29:07.337Z -->
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
Commenting: Doc Block Alignment
1+
Maintain consistent and readable PHPDoc comments across the codebase using alignment guidelines. This aids in auto-generation of documentation and facilitates easier code maintenance.
2+
3+
Example:
4+
```php
5+
/**
6+
* Retrieves user data.
7+
*
8+
* @param int $id User ID.
9+
* @param string $type Data type.
10+
* @return array User data array.
11+
*/
12+
```
13+
14+
<!-- Codacy PatPatBot reviewed: 2024-05-23T16:29:37.357Z -->
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
Commenting: Function Comment
1+
Ensure all functions are documented with PHPDoc for better readability, automatic documentation, and IDE support. For example:
2+
```php
3+
/**
4+
* Retrieves user data.
5+
*
6+
* @param int $userId The ID of the user.
7+
* @return array The user data.
8+
*/
9+
public function getUserData($userId) {
10+
// function logic
11+
}
12+
```
13+
14+
<!-- Codacy PatPatBot reviewed: 2024-05-23T16:30:01.132Z -->

0 commit comments

Comments
 (0)