Skip to content

WS003 · Runtime environment mutation

Default severity: MEDIUM · Framework: Any

Detects changes to process environment, INI settings and environment-related superglobals. Some mutations outlive a request under persistent workers; request-superglobal behavior is runtime-dependent.

  • Read configuration instead of writing it: resolve values from a config object built at boot.
  • If a value has to differ per request, pass it through the request-scoped service that needs it.
  • When a temporary change is unavoidable, restore the previous value in a finally block.
Terminal window
vendor/bin/worker-safety rules WS003

Use a targeted suppression or a baseline only after reviewing the value’s origin and lifetime. Changing an assignment elsewhere may not invalidate an existing property-level suppression.