alleyinteractive / alleyinteractive/alley-coding-standards
Add sniff for modern callback syntax
Đang mở
- Ngôn ngữ chính
- PHP
- Star
- 7
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### Description
Rather than specifying action and filter callbacks as string representations of function names, or arrays of callables in class methods (e.g., `[ $this, 'my_callback_function' ]`), we should prefer modern (PHP 8+) callback syntax, e.g., `$this->my_callback_function( ... )` or `my_callback_function( ... )`.
### Use Case
When writing modern PHP, we should use modern callback syntax, since static code analysis tools and IDEs are better able to tie the specified function to its definition.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.