609007b072
Discovered while running the existing unit tests on PHP 8.1. The default state of the protected `$distUrl` property is "not set" and the property may not be set when the `Package::setSourceDistReferences()` method gets called. Fixes a total of 9 deprecation notices along the lines of: ``` Deprecation triggered by Composer\Test\DependencyResolver\PoolBuilderTest::testPoolBuilder: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated Stack trace: 0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 597) 1 src/Composer/Package/Package.php(597): preg_match('...', NULL) 2 src/Composer/DependencyResolver/PoolBuilder.php(360): Composer\Package\Package->setSourceDistReferences('...') 3 src/Composer/DependencyResolver/PoolBuilder.php(338): Composer\DependencyResolver\PoolBuilder->loadPackage(Object(Composer\DependencyResolver\Request), Object(Composer\Package\CompletePackage)) 4 src/Composer/DependencyResolver/PoolBuilder.php(195): Composer\DependencyResolver\PoolBuilder->loadPackagesMarkedForLoading(Object(Composer\DependencyResolver\Request), Array) 5 src/Composer/Repository/RepositorySet.php(229): Composer\DependencyResolver\PoolBuilder->buildPool(Array, Object(Composer\DependencyResolver\Request)) 6 tests/Composer/Test/DependencyResolver/PoolBuilderTest.php(110): Composer\Repository\RepositorySet->createPool(Object(Composer\DependencyResolver\Request), Object(Composer\IO\NullIO)) ... ``` Side-note: I'm wondering why `$this->getDistUrl()` is used instead of using the `$distUrl` property. It is a property within the same class after all. Haven't changed it, but did want to raise the question. Refs: * https://www.php.net/manual/en/function.preg-match.php * https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg |
||
---|---|---|
.github | ||
bin | ||
doc | ||
phpstan | ||
res | ||
src | ||
tests | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.php_cs | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
LICENSE | ||
PORTING_INFO | ||
README.md | ||
UPGRADE-2.0.md | ||
composer.json | ||
composer.lock | ||
phpunit.xml.dist |
README.md
Composer - Dependency Management for PHP
Composer helps you declare, manage, and install dependencies of PHP projects.
See https://getcomposer.org/ for more information and documentation.
Installation / Usage
Download and install Composer by following the official instructions.
For usage, see the documentation.
Packages
Find packages on Packagist.
Community
Follow @packagist or @seldaek on Twitter for announcements, or check the #composerphp hashtag.
For support, Stack Overflow offers a good collection of Composer related questions, or you can use the GitHub discussions.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project and its community you agree to abide by those terms.
Requirements
PHP 5.3.2 or above (at least 5.3.4 recommended to avoid potential bugs)
Authors
- Nils Adermann | GitHub | Twitter | naderman@naderman.de | naderman.de
- Jordi Boggiano | GitHub | Twitter | j.boggiano@seld.be | seld.be
See also the list of contributors who participated in this project.
Security Reports
Please send any sensitive issue to security@packagist.org. Thanks!
License
Composer is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- This project's Solver started out as a PHP port of openSUSE's Libzypp satsolver.