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
Add coding guidelines and improve type annotations
Introduces a `.github/copilot-instructions.md` file specifying project-specific coding standards, including PSR-12 adherence, PHP 8.4+ compatibility, and testing practices.
Enhances type annotations and docblocks in `RO` class:
- Adds detailed type hints for properties and methods.
- Ensures consistency in variable initialization.
- Fixes typos and clarifies documentation.
Improves maintainability, readability, and alignment with best practices.
<!-- Use this file to provide workspace-specific custom instructions to Copilot. For more details, visit https://code.visualstudio.com/docs/copilot/copilot-customization#_use-a-githubcopilotinstructionsmd-file -->
2
+
3
+
All code comments should be written in English.
4
+
5
+
All messages, including error messages, should be written in English.
6
+
7
+
All code should be written in PHP 8.4 or later.
8
+
9
+
All code should follow the PSR-12 coding standard.
10
+
11
+
When writing code, always include a docblock for functions and classes, describing their purpose, parameters, and return types.
12
+
13
+
When writing tests, use PHPUnit and follow the PSR-12 coding standard.
14
+
15
+
When writing commit messages, use the imperative mood and keep them concise.
16
+
17
+
When writing code comments, use complete sentences and proper grammar.
18
+
19
+
When writing code, always use meaningful variable names that describe their purpose.
20
+
21
+
When writing code, avoid using magic numbers or strings; instead, define constants for them.
22
+
23
+
When writing code, always handle exceptions properly and provide meaningful error messages.
24
+
25
+
When writing code, always include type hints for function parameters and return types.
26
+
27
+
We are using the i18n library for internationalization, so always use the _() functions for strings that need to be translated.
28
+
29
+
When writing code, always ensure that it is secure and does not expose any sensitive information.
30
+
31
+
When writing code, always consider performance and optimize where necessary.
32
+
33
+
When writing code, always ensure that it is compatible with the latest version of PHP and the libraries we are using.
34
+
35
+
When writing code, always ensure that it is well-tested and includes unit tests where applicable.
36
+
37
+
When writing code, always ensure that it is maintainable and follows best practices.
38
+
39
+
When create new class or update existing class, always create or update its phpunit test files.
0 commit comments