Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

For discussion: should we return DateTime or DateTimeImmutable?

Aperta
#296 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
php
Ambito
api

Direzione di ricerca

Start with the getDateTime("date-from") API and review how the library currently represents returned DateTime values. Resolve whether DateTime or DateTimeImmutable is the intended contract, then document the decision and update the relevant behavior or tests if the project identifies them.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

question

$dateFrom = $input->getDateTime("date-from");

What type of DateTime should this library return in this case? I like the simplicity of DateTime, and with it being a getter it probably doesn't matter about immutability of the object itself, but would it make more sense or would it potentially confuse someone if the returned object was DateTimeImmutable?

Lingua principale
PHP
Stelle
3
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di phpgt/Input

Tutte le issue di phpgt/Input

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.