Skip to content

Conversation

@alcaeus
Copy link
Member

@alcaeus alcaeus commented Jun 20, 2023

The newly added script generates function maps in the format that PHPStan and Psalm use. The function map is stored in scripts/functionmap.php. The script is invoked via a make target, ensuring that the extension is built to generate the correct map:

$ make generate-function-map

The script generates maps for all functions, classes, and interfaces in the MongoDB\BSON and MongoDB\Driver namespaces.

@alcaeus alcaeus requested a review from jmikola June 20, 2023 11:55
@alcaeus alcaeus self-assigned this Jun 20, 2023
@alcaeus
Copy link
Member Author

alcaeus commented Jun 21, 2023

I made some more changes. Previously, the script always generated the function map for the installed extension version. There is now a make target called generate-function-map, which invokes the script the same way run-tests.php is invoked. This ensures that the extension is built before invoking the script with the latest extension version loaded. Additionally, the script now places a functionmap.php file in the scripts directory. This file is not committed to git, but it allows reformatting the code a little easier before copying it over to the files for PHPStan and Psalm.

Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

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

Some small suggestions but LGTM with some contributing docs added.

@alcaeus alcaeus force-pushed the sa-function-map-generator branch from 5f013af to 4880238 Compare June 22, 2023 07:37
@alcaeus alcaeus merged commit 2cb650b into mongodb:master Jun 22, 2023
@alcaeus alcaeus deleted the sa-function-map-generator branch June 22, 2023 08:25
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