Developer documentation for the initphp/input package. The project
README gives a one-page overview; this directory goes
deeper.
- Getting started — install, instantiate, and read your first value.
- Usage
- Reading sources —
get,post,rawand defaults. - Source priority — the twelve priority helpers and the "first source that has the key wins" rule.
- Validation — per-call rules and the no-fall-through behaviour.
- Presence checks —
hasGet,hasPost,hasRaw. - The facade — the static proxy,
setInstance()andreset().
- Reading sources —
- API reference — every public method, listed.
- FAQ — common pitfalls and clarifications.
Every page is structured as Goal → Working example → Expected output → Common mistakes. Snippets are copy-paste ready against the released package; outputs were verified against the test suite.
| Source | Backed by | Accessor | Presence check |
|---|---|---|---|
get |
$_GET |
get() |
hasGet() |
post |
$_POST |
post() |
hasPost() |
raw |
php://input* |
raw() |
hasRaw() |
* The raw body is read once and JSON-decoded. A non-object/array or malformed payload is treated as empty.