Automattic / Automattic/VIP-Coding-Standards

Review the WordPressVIPMinimum.Classes.DeclarationCompatibility sniff

Abierto
#507 3 comentarios 0 reacciones 0 asignados Ver en GitHub
PHPCSUtils
Lenguaje dominante
PHP
Estrellas
261
Forks
44
Merge medio
19 min
PR fusionados (30 d)
1

Descripción

Review the `WordPressVIPMinimum.Classes.DeclarationCompatibility` sniff for the following in as far as relevant to that sniff:

- [ ] Code style independent sniffing / Correct handling of quirky code
Typical things to add tests for and verify correct handling of:
- [x] Nested function/closure declarations
- [x] Nested class declarations
- [ ] Comments in unexpected places
- [ ] Variables being assigned to via `list` statements
- [ ] Multiline text strings
- [ ] Text strings provided via heredoc/nowdoc
- [ ] Use of short open tags
- [ ] Using PHP close tag as end of statement
- [ ] Inline control structures (without braces)
- [ ] Code simplifications which can be made using PHPCSUtils
- [x] Sniff stability improvements which can be made using PHPCSUtils
- [ ] Correct handling of modern PHP code
Typical things to add tests for and verify correct handling of (where applicable):
- [ ] PHP 5.0 Try/catch/finally (PHP 5.5) and exceptions
- [x] PHP 5.3 Namespaced code vs code in the global namespace
- [ ] PHP 5.3 Use import statements, incl aliasing
- [ ] PHP 5.3 Short ternaries
- [ ] PHP 5.3 Closures, incl closure use
- [ ] PHP 5.4 Short arrays
- [ ] PHP 5.5 Class name resolution using `::class`
- [ ] PHP 5.5 List in foreach
- [ ] PHP 5.5/7.0 Generators using yield and yield from
- [ ] PHP 5.6 Constant scalar expressions
- [ ] PHP 5.6 Importing via `use function/const`
- [ ] PHP 7.0 Null coalesce
- [x] PHP 7.0 Anonymous classes
- [ ] PHP 7.0 Scalar and return type declarations
- [ ] PHP 7.0 Group use statements
- [ ] PHP 7.1 Short lists
- [ ] PHP 7.1 Keyed lists
- [ ] PHP 7.1 Multi-catch
- [ ] PHP 7.1 Nullable types
- [ ] PHP 7.3 List reference assignments
- [ ] PHP 7.4 arrow functions
- [ ] PHP 7.4 numeric literals with underscores
- [ ] PHP 7.4 null coalesce equals
- [ ] PHP 7.4 Typed properties
- [x] Various versions: trailing comma's in function calls, group use, function declarations, closure use etc

Other:
- [ ] Review violation error vs warning
- [ ] Review violation severity
- [ ] Review violation message, consider adding a link
- [ ] Check open issues related to the sniff
- [ ] Review PHPDoc comments

Sniff basics, but changes need to be lined up for next major release:
- [x] Inappropriate use of `public` properties (#234)
- [ ] Modular error codes (unique error code for each distinct message)

Once PHPCS/PHPCSUtils supports this:
- [ ] PHP 8.0 Constructor property promotion
- [ ] PHP 8.0 Union types
- [ ] PHP 8.0 `match` expressions
- [ ] PHP 8.0 Nullsafe operator
- [ ] PHP 8.0 Named arguments
- [x] PHP 8.0 Single token namespaced names

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start by reading the WordPressVIPMinimum.Classes.DeclarationCompatibility sniff and reviewing its existing tests against the checklist in this issue. Identify which unchecked compatibility, stability, PHPCSUtils, severity, and messaging items are relevant, then verify the selected behavior with tests; done means the relevant checklist items are addressed and the sniff remains stable across the listed PHP syntax cases.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
php
Área
tooling
Tipo de issue
Refactorización
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
32/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.