alleyinteractive / alleyinteractive/alley-coding-standards

Add sniff for modern callback syntax

Đang mở
#77 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
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

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.