Skip to content

PHP 7.3 polyfill is not necessary because PHP 7.4 is required #1167

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

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 27 additions & 23 deletions benchmark/composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
{
"name": "mongodb/mongodb-benchmark",
"type": "project",
"repositories": [
{
"type": "path",
"url": "../",
"symlink": true
"name": "mongodb/mongodb-benchmark",
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix indentation.

"type": "project",
"repositories": [
{
"type": "path",
"url": "../",
"symlink": true
}
],
"replace": {
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*"
},
Comment on lines +11 to +14
Copy link
Member Author

Choose a reason for hiding this comment

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

The benchmark sub-project requires PHP 8.1, I disable the installation of this polyfills.

Copy link
Member

Choose a reason for hiding this comment

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

Is this the preferred method to avoid installing polyfills that are indirect dependencies? I suppose in an ideal world the polyfill packages would have some way to note that they're redundant for newer PHP versions (an inverse of requires), but there's no composer.json syntax for that.

Copy link
Member

Choose a reason for hiding this comment

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

Strictly speaking, it's not necessary to prevent installing the polyfills. The polyfill itself checks if the function exists and doesn't register itself if it does.

That said, I'm fine including these directives here until we can use PHP 8.1.

"require": {
"php": ">=8.1",
"ext-pcntl": "*",
"amphp/parallel-functions": "^1.1",
"mongodb/mongodb": "@dev",
"phpbench/phpbench": "^1.2"
},
"autoload": {
"psr-4": {
"MongoDB\\Benchmark\\": "src/"
}
},
"scripts": {
"benchmark": "phpbench run --report=aggregate"
}
],
"require": {
"php": ">=8.1",
"ext-pcntl": "*",
"amphp/parallel-functions": "^1.1",
"mongodb/mongodb": "@dev",
"phpbench/phpbench": "^1.2"
},
"autoload": {
"psr-4": {
"MongoDB\\Benchmark\\": "src/"
}
},
"scripts": {
"benchmark": "phpbench run --report=aggregate"
}
}
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"ext-json": "*",
"ext-mongodb": "^1.16.0",
"jean85/pretty-package-versions": "^2.0.1",
"symfony/polyfill-php73": "^1.27",
"symfony/polyfill-php80": "^1.27",
"symfony/polyfill-php81": "^1.27"
},
Expand Down