Automattic / Automattic/VIP-Coding-Standards
Add warning for list_files function and related
- Lingua principale
- PHP
- Stelle
- 261
- Fork
- 44
- Merge medio
- 19m
- PR unite (30g)
- 1
Descrizione
## What problem would the enhancement address for VIP?
I've recently been doing a code review and noticed the `list_files` function had no warning attached. On VIP Filesystem, the `list_files`, `scandir`, `opendir` will return empty result sets or false, so we should probably highlight this to customers to avoid unexpected results.
## Describe the solution you'd like
A warning should be added when the following functions are coded:
- list_files - WP
- scandir - PHP
- opendir - PHP
## What code should be reported as a violation?
```
$files = list_files( $folder, 2 );
```
## What code should *not* be reported as a violation?
## Additional context
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Individua le regole PHP_CodeSniffer esistenti per i controlli delle funzioni specifici di WordPress e VIP, quindi esamina come vengono definiti e testati gli avvisi. Conferma il comportamento previsto degli avvisi per list_files, scandir e opendir, incluso l'esempio list_files fornito; il lavoro è completato quando queste chiamate vengono segnalate in modo coerente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100