Automattic / Automattic/VIP-Coding-Standards

Add warning for list_files function and related

Offen
#704 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Type: Enhancement
Vorherrschende Sprache
PHP
Sterne
261
Forks
44
Ø Merge
19 Min.
Gemergte PRs (30 T.)
1

Beschreibung

## 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Finde die vorhandenen PHP_CodeSniffer-Regeln für WordPress und VIP-spezifische Funktionsprüfungen und prüfe anschließend, wie Warnungen definiert und getestet werden. Bestätige das erwartete Warnverhalten für list_files, scandir und opendir, einschließlich des mitgelieferten list_files-Beispiels; abgeschlossen ist die Aufgabe, wenn diese Aufrufe konsistent gemeldet werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
php
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.