Skip to content

Make config inflector attributes public so plugins can declare CLI and env inputs #440

Open

Description

@roxblnfk

Description

Reading a plugin's input from the CLI, env vars, php.ini or XML goes through the config inflector: a class marked #[InflectableConfig] with #[InputOption] / #[Env] / #[PhpIni] / #[XPath] properties, filled by ConfigInflector. All of it lives in Testo\Application\Config\Internal and is @internal, yet it is already the only way plugins and other core packages declare their inputs:

  • Testo\Codecov\Internal\CoverageInput (plugin/codecov)
  • Testo\Filter\Internal\FilterInput (plugin/filter)
  • Testo\Output\JUnit\Internal\JUnitInput, Testo\Output\Html\Internal\ReportInput, Testo\Output\Terminal\Internal\TerminalInput (feat(cli): add --no-progress flag to hide test progress #435)
  • Testo\Testing\Attribute\TestingSuite

Every such class is a StructArmed core.internal_is_usable_only_within_its_package violation kept in tools/structarmed/structarmed-baseline.php, and each new CLI flag adds two more entries. Third-party plugins have no supported way to read a CLI option or env var at all.

Proposed solution

  • Move the whole core/Application/Config/Internal directory (the inflector attributes InflectableConfig, InputOption, InputArgument, Env, PhpIni, XPath, XPathEmbed, XPathEmbedList, ConfigAttribute, and ConfigInflector) into a public package under core/Core (e.g. Testo\Core\Config), marked @api.
  • Switch the existing users to the new namespace and drop their entries from the StructArmed baseline.
  • Document declaring a plugin input with these attributes in the testo-plugin-author skill.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions