Skip to content

Version 8 breaks data provider plugins #1497

@dborsatto

Description

@dborsatto

Hello everyone 👋 I'm happy version 8 was finally released, but I discovered there was a change which breaks all plugins that add some sort of data provider support.

There are a few of those (including one I maintain), but basically they are all a fork with some tweaks of coduo/phpspec-data-provider-extension, and they all work by having a PhpSpec\Runner\Maintainer\Maintainer implementation which sets provided values in the CollaboratorManager. The problem is that in this PR the method CollaboratorManager::set($name, $collaborator) received a strict typing of object $collaborator, which breaks how the plugins work (as likely provided values are not objects).

I feel like the community around phpspec is shrinking (the fact that it took almost a year after PHP 8.4 was released to add support for it is quite telling), and breaking support for data provider plugins would further endanger the few of us who are left using it.

I'm not sure what to propose here. The very short term fix would be to revert the object type declaration, but it's clearly not a great solution. The best way forward would be for data providers to be a core feature, but it's likely that it would be quite the undertaking and I'm not sure how doable it would be (both in terms of architectural changes, and willingness of people to work on it).

I love phpspec, but this change makes the upgrade to PHP 8.4 impossible. Unless something changes the only way forward will be to stop using it and migrate to phpunit, I'm afraid 😞

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