Skip to content

Missing enable_metrics option to init() docblock #2183

Description

@JulienChavee

Problem Statement

The init() array-shape docblock in src/functions.php documents the accepted keys of the $options array (used for IDE/static-analysis autocompletion and as the de facto reference for SDK options). It is missing the enable_metrics key, even though the option is fully implemented and functional:

  • Options::setEnableMetrics() / Options::getEnableMetrics() exist
  • The resolver declares enable_metrics with an allowed type of bool and a default of true

Because the docblock is the primary reference IDEs (and developers) rely on for init(), users have no discoverable, type-checked way to learn that enable_metrics is a valid option — they only find it by reading Options.php directly. This is purely a documentation gap; behavior is unaffected.
It is also reported by phpstan as an error.

Solution Brainstorm

  • Minimal fix: add enable_metrics?: bool, to the @param array{...} docblock in src/functions.php, alphabetically between enable_logs and environment, matching the existing style for every other option.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions