Skip to content

LocalhostSplitManager provides invalid number of arguments to SplitView constructor #240

@tcarrio

Description

@tcarrio

Bug Report

Environment

  • Version: v7.3.0
  • Language/Platform: PHP 8.2
  • OS: macOS, Linux

Description

The SplitView class expects 8 arguments and its constructor, however the usage inside LocalhostSplitManager provide provides only six. This will be a runtime exception for local environments. This is particularly impactful for test suites that want to utilize Split flagging without a Redis instance.

Steps to Reproduce

  1. Initialize Split in localhost mode
  2. Access the manager
  3. Access the splits
  4. 💥 ArgumentCountException is thrown

Expected Behavior

Splits are safely accessed without exceptions.

Actual Behavior

Access splits in localhost mode throws exceptions.

Code Sample (if applicable)

I created a quick reproduction of the bug in the following repository: https://github.com/tcarrio/split-localhost-bug-reproduction

Disclaimer that the reproduction was scaffolded by Cursor.

I have manually modified and validated it myself. It captures the expected exception and logs so you can quickly reproduce the failure mode.

I'm using asdf so there's a .tool-versions specifying PHP 8.2. When running the project it is configured for >= 8.2 so you would need at least that set up locally. From there just composer install and composer run reproduce-bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions