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

WIP: Enhance gen_stub.php #7700

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

WIP: Enhance gen_stub.php #7700

wants to merge 7 commits into from

Conversation

m6w6
Copy link
Contributor

@m6w6 m6w6 commented Nov 28, 2021

  • prop decls for ctor promoted props
  • fix collision of namespaced functions
  • fix generating multiple declaration prefixes

Copy link
Member

@kocsismate kocsismate left a comment

Choose a reason for hiding this comment

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

And please add a test case in zend_test

@@ -2369,7 +2369,7 @@ function parseFunctionLike(
function parseProperty(
Name $class,
int $flags,
Stmt\PropertyProperty $property,
Stmt\PropertyProperty|Node\Param $property,
Copy link
Member

Choose a reason for hiding this comment

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

We aim for PHP 7.1 compatibility, so union types shouldn't be used.

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 do not understand. PHP-7 is in security-fix-only mode, so this PR is not going to land in PHP-7.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, but one can run gen_stubs.php via an earlier PHP version: e.g. I always use the version which is available on my the system (it's 8.0 in my case though).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, but ... 🤷

Copy link
Member

Choose a reason for hiding this comment

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

No, it's not a negligible issue: gen_stub.php is automatically run by the build system during compilation via the php executable which is on path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, what do you suggest? A runtime check for instanceof Stmt\PropertyProperty or Node\Param?

Copy link
Member

Choose a reason for hiding this comment

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

IMO a phpdoc would be enough, just like we did elsewhere, but I'm OK with a runtime check as well.

build/gen_stub.php Show resolved Hide resolved
@m6w6 m6w6 force-pushed the enhance-gen_stub branch from 0fcb229 to 930889a Compare January 7, 2022 18:07
@Girgias
Copy link
Member

Girgias commented Jun 8, 2022

What's the status here?

@m6w6
Copy link
Contributor Author

m6w6 commented Jun 8, 2022

What's the status here?

Kinda stuck. I'll have to find my most current stash and update it...

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.

3 participants