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

PHP 8 Support #23

Closed
ajthinking opened this issue Jul 8, 2021 · 7 comments
Closed

PHP 8 Support #23

ajthinking opened this issue Jul 8, 2021 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@ajthinking
Copy link
Owner

This package does not yet support PHP 8 features. Would love some help with this

@ajthinking ajthinking added the help wanted Extra attention is needed label Jul 8, 2021
@pkeogan
Copy link

pkeogan commented Sep 12, 2021

@ajthinking just spent my day adding php 8.0 features and finishing your ->add()->trait([...]) functions, added features also to reproduce findOrCreate related functionality. also added some automatic phpunit feature testing functions. Also added function to sort the use /trait statements by length. Also added formatters to clean up laravel based code to go over existing code to match @taylorotwell preferred visually coding methods.

image
All the above code was generated with PHPFile::

I would make a PR , but my code does not follow your project structure at all, and breaks its nice formatting/setup. Ive done quite a bit of method chaining based packages, but you took it to another level. I am always interesting in learning new ways, and if your willing to explain it to me a little over VoIP I can conform the changes, otherwise I plan on branching off from your v0.2.5 release.

@ajthinking
Copy link
Owner Author

Thanks for taking a look at this 👍 Would love to merge it and assist with any questions. Im available today preferably or weekday evenings ECT

@pkeogan
Copy link

pkeogan commented Sep 16, 2021

Got caught up with a project past few days, I'll send you an email to try and setup something next week.

@ajthinking
Copy link
Owner Author

@pkeogan, could you share the branch? Would love to see it

@lukas-frey
Copy link

lukas-frey commented Aug 10, 2022

Is this actually completed? I can't seem to find a way to add traits using PHPFile.

EDIT: I managed to add a trait using ASTBuilder / BuilderFactory, like this:

$builder->class()->insertStmt((new BuilderFactory())->useTrait('HasRoles')->getNode())

however not using the defined endpoints like there are for implements, extends, etc.

I fear I'm not experienced enough to make a PR to add the endpoint though.

@ajthinking
Copy link
Owner Author

Hi @LukasFreyCZ , thanks for bumping and nice work around.
It was never merged, so we are still missing some things related to traits.
I will try to take a look at it this weekend, will ping you if/when there is a release

@lukas-frey
Copy link

Hi @LukasFreyCZ , thanks for bumping and nice work around.
It was never merged, so we are still missing some things related to traits.
I will try to take a look at it this weekend, will ping you if/when there is a release

Sounds great, thanks! If you need some help, feel free to message/tag me and I'll try my best. :) Even if it's just for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants