1. Check and follow the Drupal Coding Standards.
2. Avoid hard-coding.
3. When introducing a new class, define a corresponding interface as a general rule.
4. Add return type declarations to methods and functions.
5. For Entity Queries, add `->accessCheck(TRUE)` after `->getQuery()`, for example, `->getQuery()->accessCheck(TRUE)`.
6. Avoid inheritance where possible and prefer composition.
7. Avoid static service calls such as `\Drupal::service()` inside classes and use dependency injection. Files with the `.module` extension are an exception.
8. Prefer `!empty()` over `isset()` when it is appropriate for the expected behavior.
9. Prefer `array_map()` over `foreach` where appropriate.
10. Add `static` to closures whenever possible, for example, `array_map(static function () { ... }, $items)`.
11. When an array or iterable may be empty or `NULL`, use the form `foreach ($items ?: [] as $item)`.
12. Consider the ternary expression `Condition ? A : B` when a simple two-way `if` and `else` branch is sufficient.
13. Validate variable safety to prevent Internal Server Errors caused by `NULL` pointers, undefined array keys, unexpected types, or similar issues.
14. To support strict type declarations in PHP 8.2 and later, provide safe defaults when processing strings, for example, `trim($value ?: '')`.
15. When conditional branches are nested, consider simplifying the logic with guard clauses.
16. As a general rule, structure code without `else`.
17. Use `CloudContentEntityTrait::processOperationStatus()` or `CloudContentEntityTrait::processOperationErrorStatus()` for all CRUD operations.
18. Sort `use` statements alphabetically.
19. Refer to RFC 5424 for log levels. As a general rule, use `logger('module_name')->info()` or `logger('module_name')->error()`.
20. Do not use jQuery libraries.
