Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate tightenco/collect to illuminate/collections #40

Merged
merged 6 commits into from
Nov 7, 2022

Conversation

joelambert
Copy link
Member

Migrate from tightenco/collect to illuminate/collections.

There will be a lot of user land code with reference to the Tighten namespace so add aliases that transparently use the Illuminate variants instead. Specifically we want to support the transparent use of Collection and Arr.

The Tighten package also brought in symfony/var-dumper, exposing dd() and dump() which Illuminate doesn't. So to minimise upgrade issues we now also require this package from lumberjack-core.

Joe Lambert added 3 commits June 24, 2022 13:47
1. Can use Tightenco namespace
2. Can use Illuminate namespace
3. Can use `collect()` helper
@joelambert
Copy link
Member Author

@adamtomat more real world testing will be required to fully assess the impact of the switch over. We will need to consider whether this is considered a breaking change too.

@szepeviktor
Copy link
Contributor

szepeviktor commented Jun 24, 2022

Please consider adding some kind of switch that does not add class aliases.
Some people strive to write clean code thus replacing Tighten\*.

@joelambert
Copy link
Member Author

Please consider adding some kind of switch that does not add class aliases.
Some people strive to write clean code thus replacing Tighten\*.

@szepeviktor the aliases don't prevent you from exclusively using the new namespaces and replacing the old ones in your own code. They just don't force everyone to do that and provides a more graceful upgrade path without unnecessary friction.

@szepeviktor
Copy link
Contributor

szepeviktor commented Jun 24, 2022

Excuse me. I was not daring enough.

"Some people vomit from class aliases." ... mainly lab-type 🧪 guys 👨🏻‍🔬

@joelambert joelambert marked this pull request as ready for review November 7, 2022 11:46
@joelambert joelambert changed the title Update collections Migrate tightenco/collect to illuminate/collections Nov 7, 2022
@joelambert joelambert merged commit 7aa85d5 into add-php-81-support Nov 7, 2022
@joelambert joelambert deleted the update-collections branch November 7, 2022 11:52
joelambert added a commit that referenced this pull request Apr 5, 2023
* Add return type annotations

Tells PHP 8.1 not to raise the deprecation warning around mixed return types without breaking backwards compatibility with PHP 8.0 and below.

https://stackoverflow.com/a/71133750

* Specify the error level

`null` is no longer accepted in PHP 8.1

* Update dependencies for PHP 8.1 support

* Update CI PHP versions

Drop support for PHP 7.3 and add support for PHP 8.1

* Allow `composer/installers` to be installed

* Update minimum dependencies

* Update more minimum dev dependencies

* Increase minimum version of `statamic/stringy`

* Increase Timber version to release supporting 8.1

* Migrate `tightenco/collect` to `illuminate/collections` (#40)

* Ensure `dd()` and `dump()` are present

* Ensure Collections are present

1. Can use Tightenco namespace
2. Can use Illuminate namespace
3. Can use `collect()` helper

* Update to `illuminate/collections`

* Test legacy function signatures are happy

* Use a version of 8.x which supports PHP 8.1

Co-authored-by: Joe Lambert <joe@rareloop.com>

* Default the domain to ‘’ for PHP 8.1 support

This is the recommended approach to support PHP 8.1 and maintain backwards compatibility. It is also how WordPress have approached this.

* Allow custom error levels to be report only (#44)

Also added `E_DEPRECATED` to the list by default

Co-authored-by: Joe Lambert <joe@rareloop.com>

* Remove collection aliasing

---------

Co-authored-by: Joe Lambert <joe@rareloop.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants