Skip to content

Enhance ext/dom stubs#1702

Merged
isfedorov merged 9 commits intoJetBrains:masterfrom
Girgias:DOM-template
Dec 14, 2024
Merged

Enhance ext/dom stubs#1702
isfedorov merged 9 commits intoJetBrains:masterfrom
Girgias:DOM-template

Conversation

@Girgias
Copy link
Copy Markdown
Contributor

@Girgias Girgias commented Dec 8, 2024

Should be reviewed, and merged as individual commits.

@nielsdos could you have a quick look to see if I didn't make a wrong assumption somewhere?

@Girgias
Copy link
Copy Markdown
Contributor Author

Girgias commented Dec 8, 2024

The 8.4 CI failure seems to be that the stubs don't actually understand what a covariant template is?

Copy link
Copy Markdown
Contributor

@ndossche ndossche left a comment

Choose a reason for hiding this comment

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

Just checked this. Almost right

@isfedorov
Copy link
Copy Markdown
Contributor

Hey folks, thanks for the PR! Some of the tests are failing at the moment, due to not supported processing of @template T as Type notation. Right now tests just take template name and convert it later to object during comparison with signature. So the tests should be updated to store now only template name, but also template types (\StubTests\Model\PHPDocElement::collectTags) and use an appropriate type later during comparison with function signature (\StubTests\StubsTypeHintsTest::testClassesMethodsSignatureTypeHintsConformPhpDocInMethods). any chance you could take a look and try to fix them? It’ll help get the PR merged faster. If not, no worries, we’ll sort it out on our side later, just with a bit of a delay.

@Girgias
Copy link
Copy Markdown
Contributor Author

Girgias commented Dec 11, 2024

I will try to fix the tests, just wasn't sure what the approach to fix them should be. :)

@Girgias Girgias force-pushed the DOM-template branch 3 times, most recently from 03a0f39 to ee5894e Compare December 11, 2024 23:13
@isfedorov
Copy link
Copy Markdown
Contributor

@Girgias Thank you for fixing tests! All the changes looks good. Could you please take a look at inline comments and fix related items. After that PR can be merged.

@Girgias
Copy link
Copy Markdown
Contributor Author

Girgias commented Dec 12, 2024

@isfedorov, did you forget to submit the inline comments? I can't see any.

dom/dom_c.php Outdated
* The DOMNodeList class
* @link https://php.net/manual/en/class.domnodelist.php
*
* @template-covariant TNode as DOMNode|DOMNameSpaceNode
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, that's not supported by tests at the moment. Need to update parses to properly process union types in templates

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@isfedorov
Copy link
Copy Markdown
Contributor

@isfedorov, did you forget to submit the inline comments? I can't see any.

🤦 Indeed! Sorry, published review now.

@Girgias
Copy link
Copy Markdown
Contributor Author

Girgias commented Dec 12, 2024

I don't really understand why there are now PGSQL failures on the 8.4 CI :(

@isfedorov
Copy link
Copy Markdown
Contributor

@Girgias I believe the failures are not related to your changes but related to the updated PHP 8.4 docker image.
Screenshot 2024-12-12 at 22 29 14

1) StubTests\BaseConstantsTest::testConstants with data set "constant \LIBXML_NO_XXE" ('\LIBXML_NO_XXE')
Missing constant: const \LIBXML_NO_XXE = 8388608

2) StubTests\BaseConstantsTest::testConstants with data set "constant \PGSQL_TUPLES_CHUNK" ('\PGSQL_TUPLES_CHUNK')
Missing constant: const \PGSQL_TUPLES_CHUNK = 12

3) StubTests\BaseFunctionsTest::testFunctionsExist with data set "function \pg_set_chunked_rows_size" ('\pg_set_chunked_rows_size')
Missing function: function \pg_set_chunked_rows_size(Pgsql\Connection $connection, int $size){}

Tests are not bound to a strict version of PHP and use just latest minor updates of major versions so I suppose the related docker image was just updated at some moment in between your commits and new entities were added

@isfedorov
Copy link
Copy Markdown
Contributor

@Girgias Could you please revert changes in files under .idea folder? Those are local specific changes and shouldn't be stored in VCS.

@Girgias
Copy link
Copy Markdown
Contributor Author

Girgias commented Dec 13, 2024

@Girgias Could you please revert changes in files under .idea folder? Those are local specific changes and shouldn't be stored in VCS.

Should the folder be added to .gitignore?

@isfedorov
Copy link
Copy Markdown
Contributor

@Girgias It's already partially added. I wouldn't add the whole directory since some of its files may be good to share via VCS and also some of the files can contain both, content that does make sense to share and content that doesn't so every single case should be considered separately. Thank you for the fix!

@isfedorov isfedorov merged commit 2632ba1 into JetBrains:master Dec 14, 2024
@Girgias Girgias deleted the DOM-template branch December 14, 2024 12:28
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.

4 participants