Skip to content

Commit

Permalink
gpt: Automated pattern documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklem authored and github-actions[bot] committed May 23, 2024
1 parent af156c5 commit fa27c13
Show file tree
Hide file tree
Showing 5 changed files with 14,990 additions and 12,181 deletions.
15 changes: 14 additions & 1 deletion docs/description/CakePHP_Classes_ReturnTypeHint.md
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
Classes: Return Type Hint
To improve code clarity and static analysis, always define return type hints in your CakePHP class methods. This practice helps catch type errors early and aids in maintaining a robust codebase.
```php
// Example of a method without a return type hint
public function calculateTotal() {
return 123.45;
}

// Improved version with return type hint
public function calculateTotal(): float {
return 123.45;
}
```

<!-- Codacy PatPatBot reviewed: 2024-05-23T16:21:58.634Z -->
19 changes: 18 additions & 1 deletion docs/description/CakePHP_Commenting_DocBlockAlignment.md
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
Commenting: Doc Block Alignment
Align doc blocks uniformly to improve readability and facilitate clean code diffs. Use tools like PHP Code Sniffer (PHPCS) to automate the alignment process.
```php
// Misaligned doc block example
/**
* Summary description.
* @param string $param Description.
* @return void
*/

// Correctly aligned doc block
/**
* Summary description.
* @param string $param Description.
* @return void
*/
```

<!-- Codacy PatPatBot reviewed: 2024-05-23T16:22:58.511Z -->
16 changes: 15 additions & 1 deletion docs/description/CakePHP_Commenting_FunctionComment.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
Commenting: Function Comment
Ensure every function in your CakePHP project has a well-structured comment. This enhances code readability and aids in generating automated documentation.
```php
/**
* Calculates the total price.
*
* @param float $price The price of the item.
* @param float $tax The applicable tax rate.
* @return float The total price including tax.
*/
public function calculateTotal(float $price, float $tax): float &#x7B;
return $price + ($price * $tax);
&#x7D;
```

<!-- Codacy PatPatBot reviewed: 2024-05-23T16:23:56.291Z -->
Loading

0 comments on commit fa27c13

Please sign in to comment.