Skip to content

illuminate/collections still coupled to illuminate/support #38389

@drbyte

Description

@drbyte
  • illuminate/collections Version: 9.0-dev = dev-master = commit hash d17728b
  • PHP Version: 8.0.9

Description:

According to #32478, #32481, #32506 the intent of creating illuminate/collections was to remove the dependency on illuminate/support.
While this appears to be operational in v8.54.0, it is broken in 9.0-dev.

While exploring converting Valet from using tightenco/collect to illuminate/collections with 9.0-dev, it reveals that illuminate/collections 9.0-dev is still highly coupled to illuminate/support

More specifically, the illuminate/collections 9.0-dev currently package depends on (requires) the illuminate/support package to provide the Conditionable trait and its associated Enumerable implementations.

Fatal error: Trait "Illuminate\Support\Traits\Conditionable" not found in .../valet/vendor/illuminate/collections/Traits/EnumeratesValues.php on line 47

Attempting to bypass use Conditionable; exposes more of the dependency details:

PHP Fatal error:  Class Illuminate\Support\Collection contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Illuminate\Support\Enumerable::when, Illuminate\Support\Enumerable::unless) in .../valet/vendor/illuminate/collections/Collection.php on line 13

Steps To Reproduce:

  • git clone [email protected]:laravel/valet.git
  • add "minimum-stability": "dev", to composer.json
  • composer remove tightenco/collect
  • composer require illuminate/collections:^9.0 illuminate/container:^9.0 --with-all-dependencies
  • run either ./valet or phpunit

Aside: Changing the ^9.0 to ^8.0 avoids the reported errors, so it seems to be isolated to the 9.0-dev branch.

/cc @mattstauffer
/ref tighten/collect#217

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions