Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Change namespace to TightenCo and alias to Illuminate namespace #56

Merged
merged 10 commits into from
Jan 31, 2018

Conversation

damiani
Copy link
Contributor

@damiani damiani commented Sep 15, 2017

Resolves #54

I agree that moving this to a TightenCo namespace makes sense, and that we need to provide a fallback Illuminate namespace for existing users. @adamwathan's PR (#55) does this by duplicating all the classes, but I think @RemiCollin's solution (#54 (comment)) to alias the classes would be easier to maintain.

I believe this PR accomplishes that—it loads an alias.php file via composer, which takes care of it all. This works in my testing...but a second (or third or fourth) set of eyes on this would be appreciated, preferably by someone with more composer chops than I have 😆

@mattstauffer
Copy link
Member

Can we rename TightenCo to Tightenco to be consistent with our other packages?

I like this way a lot. Let me give it a day for us to think of other potential problems.

@damiani
Copy link
Contributor Author

damiani commented Sep 15, 2017

No.

@damiani
Copy link
Contributor Author

damiani commented Sep 15, 2017

Oh, OK fine. :)

if (! class_exists($illuminate) && ! interface_exists($illuminate) && ! trait_exists($illuminate)) {
class_alias($tighten, $illuminate);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we would be wiser to alias either all classes, or none of them if there's a single conflict. Theoretically, we could end up with a mixture of Laravel and Collect classes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sort of doubt it, but I still like the idea of a single check instead of many.

@mattstauffer mattstauffer merged commit 939558f into master Jan 31, 2018
@mattstauffer mattstauffer deleted the kd-tightenco-namespace branch January 31, 2018 20:57
antonioribeiro added a commit to antonioribeiro/collect that referenced this pull request Jan 31, 2018
@mathieutu
Copy link

Guys, how do you handle the conflicts with Laravel now?
My package now import Tightenco\Collect\Support\; classes, but with the Laravel composer.json replace, this classes will not be found in a Laravel project. How have you planed that?
Thanks!

@mathieutu
Copy link

Ok, I'm just seeing that : laravel/framework@5caa88a

anthonyhuffman116 added a commit to anthonyhuffman116/collect that referenced this pull request Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants