Skip to content

Replace the positional configuration relay with a single value object #256

Description

@AlexSkrypnyk

Deferred from the codebase convergence work. Every fix here renames or reshapes a published symbol of this library, so it is a backward-compatibility break and was deliberately left out of the non-breaking follow-up.

Summary

Configuration reaches ScreenshotContext through a chain of long positional argument lists. Adding one config key today means editing five signatures across three files.

Details

The relay: the config tree, then a 10-element positional argument array on the service Definition, then a 10-argument initializer constructor, then a 9-argument setScreenshotParameters(), then the context properties.

Nothing checks that the five orderings agree. They currently differ already: purge appears in the constructor but not in setScreenshotParameters().

Two smaller defects sit in the same area and are worth fixing in the same change:

  • ScreenshotAwareContextInterface::screenshot(array $options) declares no default, while the implementation declares $options = []. The signatures disagree.
  • The interface exposes 4 methods while the implementation has roughly 10 more public ones - getDir(), saveScreenshotContent(), getScreenshot(), the hooks and the step methods - so the interface does not describe the type consumers actually work with.

Every remedy - a config value object, adding the missing default, widening the interface - edits the published contract, which is why none was done in the non-breaking pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions