1401 Commits (3fa7a6cb5104cc2235a767ee7b2df1475c4763a0)

Author SHA1 Message Date
Martin Herndl 995bf5a932
Add types to `Util` namespace, refs #10159 (#10190) 3 years ago
Stephan 261d93aacf
ComposerRepository: handle packages.json with null value for package (#10189) 3 years ago
Jordi Boggiano d1c8a4d1b4
Lots of typing improvements 3 years ago
Jordi Boggiano a7963b7fed
Fix ComposerRepository handling of offline state to allow resolution as long as everything is present in the cache, fixes #10116 3 years ago
Stephan edccad4e05
VcsRepository: do not continue when receiving 429 rate limit exception (#10132) 3 years ago
Alexander Schranz 99c6b450e6
Check for returned link header in GithubDriver 3 years ago
Jordi Boggiano 01d734125c
Add more type info 3 years ago
powellblyth 5e75017166
Just some comments with 'it's' that should have been 'its' (#10071)
Co-authored-by: Toby Powell-Blyth <tobypowell-blyth@elasticstage.com>
3 years ago
Jordi Boggiano d3c176ec69
PHPStan Level 5 (#10070)
* Bump PHPStan to level 5

* Update seld/phar-utils to latest

* Add phpstan-setup / phpstan scripts
3 years ago
Jordi Boggiano 8ce0ea300e
Fix pear repo preventing self-update from functioning, fixes #10049 3 years ago
Juliette f5a0dfeb50
PHP 8.1: fix deprecation warnings about incorrect default values (#10036)
* PHP 8.1/Tests: fix some deprecation warnings

The default value for the `preg_split()` `$limit` parameter is `-1`, not `null`.

Fixes numerous `preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated` notices when running the test suite.

Ref: https://www.php.net/manual/en/function.preg-split.php

* PHP 8.1/NoProxyPattern: fix deprecation warning

The default value for the `preg_split()` `$limit` parameter is `-1`, not `null`.

Fixes some `preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated` notices when running the test suite.

```
Deprecation triggered by Composer\Test\Util\Http\ProxyManagerTest::testGetProxyForRequest:
preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated

Stack trace:
0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 42)
1 src/Composer/Util/NoProxyPattern.php(42): preg_split('...', '...', NULL, 1)
2 src/Composer/Util/Http/ProxyManager.php(148): Composer\Util\NoProxyPattern->__construct('...')
3 src/Composer/Util/Http/ProxyManager.php(50): Composer\Util\Http\ProxyManager->initProxyData()
4 src/Composer/Util/Http/ProxyManager.php(59): Composer\Util\Http\ProxyManager->__construct()
5 tests/Composer/Test/Util/Http/ProxyManagerTest.php(75): Composer\Util\Http\ProxyManager::getInstance()
...
```

Ref: https://www.php.net/manual/en/function.preg-split.php

* PHP 8.1: fix deprecation warnings / http_build_query()

This fixes all relevant calls to the PHP native `http_build_query()` function.
The second parameter of which is the _optional_ `$numeric_prefix` parameter which expects a `string`.

A parameter being optional, however, does not automatically make it nullable.

As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice.
In this case, these function calls yielded a `http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated` notice.

Changing the `null` to an empty string fixes this without BC-break.

Fixes a few deprecation warnings found when running the tests.

Refs:
* https://www.php.net/manual/en/function.http-build-query.php
* https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

* PHP 8.1: fix deprecation notices / PharData::__construct()

This fixes all relevant calls to the PHP native `PharData::__construct()` method.

The second parameter of this method is the _optional_ `$flags` parameter which expects an `int` of flags to be passed to the `Phar` parent class `RecursiveDirectoryIterator`.
Fixed by passing the default value for the `$flags` parameter as per the `RecursiveDirectoryIterator::__construct()` method.

The third parameter of the method is the _optional_ `$alias` parameter which expects an `string`.
Fixed by passing an empty string.

Fixes various notices along the lines of:
```
Deprecation triggered by Composer\Test\Package\Archiver\ArchiveManagerTest::testArchiveTar:
PharData::__construct(): Passing null to parameter #2 ($flags) of type int is deprecated

Stack trace:
0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 55)
1 src/Composer/Package/Archiver/PharArchiver.php(55): PharData->__construct('...', NULL, NULL, 2)
2 src/Composer/Package/Archiver/ArchiveManager.php(193): Composer\Package\Archiver\PharArchiver->archive('...', '...', '...', Array, false)
3 tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php(65): Composer\Package\Archiver\ArchiveManager->archive(Object(Composer\Package\CompletePackage), '...', '...')
...
```

Refs:
* https://www.php.net/manual/en/phardata.construct.php
* https://www.php.net/manual/en/recursivedirectoryiterator.construct.php

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
3 years ago
Jordi Boggiano 2f83338d2f
Fix hopefully last php 8.1 deprecation warnings 3 years ago
Jordi Boggiano 24f5e54fbe
Fix only/exclude to avoid matching names as sub-strings of full package names, fixes #10001 3 years ago
Jordi Boggiano 10ae1d7b08
Fix some PHP 8.1 deprecation warnings, fixes #10008 3 years ago
Ondřej Mirtes 58ced29a2a
Simplify code 3 years ago
Jordi Boggiano 005c55185a
Fix support for writing into UNC paths, and comparing UNC paths correctly in InstalledVersions, fixes #9993 3 years ago
Jordi Boggiano 1b34495daa
Some phpstan level 4 fixes 3 years ago
Jordi Boggiano 4c9e75c6e5
Fix CS 3 years ago
Brad Jones dd625669e8
Introduce gitlab-protocol option to force the gitlab repos to use https or git protocol (#9401) 3 years ago
Jordi Boggiano 82cffa17d3
Undo addition of initializeInstalled and remove inline copy of the data from the class 3 years ago
Jordi Boggiano 3fe4f84a76
Fix handling of metapackages with null paths, and handling of paths which do not have a shortest-path and require an absolute path to be addressed 3 years ago
Jordi Boggiano 518b44a810
Clean up dump code to avoid reimplementing var export, and remove DIRECTORY_SEPARATOR 3 years ago
Jordi Boggiano 8335b49cf0
Rename dev-requirement to dev_requirement for consistency 3 years ago
Jochen Roth b6c9d34125
Add install-path and type to installedVersions.php and installed.php, add method to get installed packages by type
Issue https://github.com/composer/composer/issues/9648
3 years ago
Jordi Boggiano 9ba042ded8
Add Platform-PHP version to user-agent header to improve targetted-php stats (#9873) 3 years ago
Jordi Boggiano 40c7a725e1
Merge branch '2.0' 3 years ago
Jordi Boggiano 332c46af8b
Merge pull request from GHSA-h5h8-pc6h-jvvx
* Fix external process calls to avoid user input being able to pass extra parameters

* Tweak some fixes
3 years ago
Adam e291aa1d12
Allow PreFileDownloadEvent to carry transport options for metadata (#9831) 3 years ago
Adam 180ba49f33
ComposerRepository::asyncFetchFile() does not pass the downloaded URL to PostFileDownloadEvent (#9827) 3 years ago
Jordi Boggiano d75d79b452
Merge pull request #9822 from phenaproxima/post-file-download
Fire POST_FILE_DOWNLOAD event for metadata fetched by ComposerRepository
3 years ago
Jordi Boggiano 9a9c738f23
Add repository instance to Pre/PostFileDownloadEvent metadata 3 years ago
Jordi Boggiano 7dd95a768b
Clean stuff up and deprecate old usages for PostFileDownloadEvent 3 years ago
Phéna Proxima df0a2cdd0a Fire POST_FILE_DOWNLOAD event for metadata fetched by ComposerRepository. 3 years ago
Jordi Boggiano a4eb2d4096
Merge branch '2.0' 3 years ago
Jordi Boggiano ddc3693725
Switch to composer/metadata-minifier, fixes #9727 3 years ago
Adam 29befaa94b
Make ComposerRepository::configurePackageTransportOptions() protected. (#9818) 3 years ago
Jordi Boggiano 1179e4b481
Change root.dev-requirement to root.dev in installed.php as the root is not required per se, and this simply tracks the dev mode at install time 3 years ago
Jordi Boggiano 5d6f9b2528
Prefer @phpstan- annotations as that is what we run against 3 years ago
Jordi Boggiano 059b5b197d
Merge branch '2.0' 3 years ago
Jordi Boggiano 17747181d0
Clarify behavior of name in VCS repo, closes #9752 3 years ago
Jordi Boggiano 4940009f83
Bump phpstan to level 3 (#9734)
Clean up PackageInterface/CompletePackageInterface, add missing methods, type things in solver as BasePackage, added CompleteAliasPackage, ..
3 years ago
Jordi Boggiano 8392508e23
Merge branch '2.0' 3 years ago
Jordi Boggiano de8a737015
Fix var shadowing 3 years ago
Jordi Boggiano 40800df6bd
Fix CS 3 years ago
Jordi Boggiano 7c555b6382
Merge pull request #9682 from nicolas-grekas/installed-no-dev
Allow querying InstalledVersions::isInstalled() for no-dev packages
3 years ago
Jordi Boggiano 8da3b3b9be
List relevant conflicts in why/why-not, fixes #9693 3 years ago
Nicolas Grekas 7d4501816c Allow querying InstalledVersions::isInstalled() for no-dev packages 3 years ago
Jordi Boggiano 03e8cacd12
Merge pull request #9696 from Seldaek/fix_installed_versions_during_update
Fix installed versions usage issues when using it in plugins during a Composer update process
3 years ago
Jordi Boggiano f7e8f7625f
Remove plugin installer hackery 3 years ago
brandonkelly 62af444821 Check if SODIUM_LIBRARY_VERSION is defined 3 years ago