1121 Commits (e918b6001b4b2bdb6b5f8bfb53c62c11a87eb6de)

Author SHA1 Message Date
Jordi Boggiano 4e6d54b731
Fix all 5.3 $this-in-closure usages 3 years ago
Jordi Boggiano 5805a68645
Fix some todos dropping support for older Symfony releases 3 years ago
Jordi Boggiano 7e27a25070
Get rid of RetutnTypeWillChange where possible, fixes #10014 3 years ago
Jordi Boggiano 0b3adc84da
Fix a few phpstan errors and add a php8+ baseline for the rest 3 years ago
Jordi Boggiano 96486d81cb
Fix many PHPStan issues and update baseline 3 years ago
Jordi Boggiano ffd62795bc
Get rid of all the ->at() mock invocations 3 years ago
Jordi Boggiano 24ce1eddbd
Add composer/pcre dependency and use it everywhere instead of preg_* 3 years ago
Wataru Kurashima 10f8edb816
fix typo (#10331) 3 years ago
Jordi Boggiano 7e3626362e
Add support for warnings/infos keys to report more complex information to diverse Composer versions 3 years ago
Jordi Boggiano 7fc9000834
Also retry for SSL connection failures, refs #10124 3 years ago
Jordi Boggiano f509c41280
Upgrade PHPStan to 1.0 (#10253)
Co-authored-by: Martin Herndl <martin@herndl.org>
3 years ago
Jordi Boggiano ba1814f306
Added retry behavior for certain http status and curl error codes (#10162) 3 years ago
Jordi Boggiano bd4d624cc7
Read first from $_SERVER and $_ENV before using getenv (#10218) 3 years ago
Matthias Pigulla 4c9e567c39
Provide different URL options to encourage users to create low-privilege GitHub tokens (#10256) 3 years ago
Jordi Boggiano 44b69ba77f
Upgrade php-cs-fixer to 3.x and fix CS 3 years ago
Martin Herndl 2992e8651a
Add types to `Util` tests (#10228) 3 years ago
Martin Herndl fa4d4e20e9
Add types to `Downloader` (#10193) 3 years ago
Martin Herndl 995bf5a932
Add types to `Util` namespace, refs #10159 (#10190) 3 years ago
Martin Herndl f0cc9aeb01
Remove scalar parameter type declaration (#10186)
`string` can only be used in parameters starting from PHP 7.0.
3 years ago
Jordi Boggiano 626370d444
Suggest COMPOSER_DISABLE_NETWORK if a possibly-offline state is detected (#10163)
Co-authored-by: Nils Adermann <naderman@naderman.de>
3 years ago
Jordi Boggiano 2828ce59cf
Merge branch '1.10' 3 years ago
Jordi Boggiano aa4de3b13d
Fix CurlDownloader requesting gzip encoding even though unsupported, fixes #10153 3 years ago
John Stevenson 906442117c Carriage returns are ignored by cmd 3 years ago
Jordi Boggiano d1c8a4d1b4
Lots of typing improvements 3 years ago
Jordi Boggiano 1e3f7cfcba
Fix handling of json error responses 3 years ago
John Stevenson 8f974fe741 Improve Windows escaping 3 years ago
Jordi Boggiano cb1e248258
Fix type annotation 3 years ago
Jordi Boggiano 18e24976c1
Merge branch '1.10' 3 years ago
Jordi Boggiano ca5e2f8d50
Fix escaping issues on Windows which could lead to command injection, fixes GHSA-frqg-7g38-6gcf 3 years ago
Jordi Boggiano b3eebeb3b9
Merge pull request from GHSA-frqg-7g38-6gcf 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
Sergii Dolgushev 90d112d98a
Mask Git credentials in the error message (#10115) 3 years ago
Vitaly Baev 7305d50277
Changed GitLab's applications URL (#10104) 3 years ago
Jordi Boggiano 6179f33c74
Fix docker being seen as WSL when run inside WSL, fixes #10094 3 years ago
Jordi Boggiano 6c9aecf4e7
Ignore all symfony deprecations 3 years ago
Jordi Boggiano 0761474599
Add type info to many properties/methods 3 years ago
Jordi Boggiano 024f0eda53
Add a bunch of type info to Util namespace 3 years ago
Jordi Boggiano b8e461ea61
Make sure /proc/version read does not fail the process ever, closes #10080 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 a586a753df
Fix all remaining php8.1 test suite deprecations 3 years ago
Jordi Boggiano 6aa2d15868
Introduce ProcessExecutorMock to fix deprecations and amount of mocking pain 3 years ago
Jordi Boggiano c5a02a2b58
Fix return value of ProcessExecutor::getErrorOutput, closes #10054 3 years ago
Stephan c65bd832d6
Url: fix sanitize for new github tokens (#10048) 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 1f4401005c
Allow default_socket_timeout to extend the curl timeout if it is longer than 300s, fixes #10018 3 years ago
Jordi Boggiano 2be03f0d60
More fixes for php8.1 deprecations 3 years ago
Jordi Boggiano a7efb27338
More php8.1 deprecation fixes, refs #10008 3 years ago
Jordi Boggiano 47cf602f9e
Fix more PHP 8.1 deprecations, refs #10008 3 years ago
Ondrej Mirtes 79093d664b Update PHPStan and remove ignore 3 years ago
Jordi Boggiano bacbd15b6b
Fix open_basedir support regession in bfea0f7d1 3 years ago
Jordi Boggiano cc81f5bac3
Fix support for UNC paths in normalizePath, refs #9993 3 years ago
Jordi Boggiano 6c1f0cdf24
Handle edge cases too in removeDirectoryPhp to avoid trying to delete symlinks and such, fixes #9955 3 years ago
Jordi Boggiano f61f2c6872
Also free $file just in case 3 years ago
Jordi Boggiano c4f675fe84
Fix virtualbox filesystem issue when installing packages, fixes #9945 3 years ago
Jordi Boggiano c1f0eee154
Revert "Attempt fixing virtualbox issues, refs #9945"
This reverts commit 7a7e0cc031.
3 years ago
Jordi Boggiano 7a7e0cc031
Attempt fixing virtualbox issues, refs #9945 3 years ago
Jordi Boggiano 288e19153d
Alternative fix for #9941 to avoid code duplication 3 years ago
Jordi Boggiano d77ff0f729
Workaround for PCRE regression 3 years ago
Jordi Boggiano 1b34495daa
Some phpstan level 4 fixes 3 years ago
Jordi Boggiano 4c9e75c6e5
Fix CS 3 years ago
Jordi Boggiano 10e634890e
Good morning 😴 3 years ago
Jordi Boggiano 91dd175f74
Fix env var handling when variables_order includes E and symfony/console 3.3.15+ is used, fixes #9930 3 years ago
Jordi Boggiano 93a5b27631
Add prettyVersion to URL placeholders 3 years ago
Guilliam Xavier 41c66b1a2d Revert "Update docs and add more helpful output to validate command, refs #9782"
This reverts commit 458bd41d8f.
3 years ago
Jordi Boggiano 458bd41d8f
Update docs and add more helpful output to validate command, refs #9782 3 years ago
Jordi Boggiano 991985792d
Merge branch '2.0' 3 years ago
Jordi Boggiano 251b852fd2
Make sure async processes fail the promise if they fail to start, fixes #9808 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 5bf614a762
Merge branch '2.0' 3 years ago
Jordi Boggiano dd54f295fe
Fix progress output, and remove progress bar on CI env, fixes #9621, closes #9880 3 years ago
Jordi Boggiano 3380178798
Introduce a cross-platform safe version of is_readable to support UNC / wsl$ paths on Windows (#9861) 3 years ago
Markus Staab bfea0f7d1e
BinaryInstaller: install full binaries on WSL when bin-compat=auto (#9855) 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
Jordi Boggiano 083b73515d
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
Markus Staab 7c602d8807
Added link to composer.org docs on ProcessTimedOutException (#9796) 3 years ago
Jordi Boggiano a4eb2d4096
Merge branch '2.0' 4 years ago
Jordi Boggiano ddc3693725
Switch to composer/metadata-minifier, fixes #9727 4 years ago
Jordi Boggiano dca8bd7197
Merge branch '2.0' 4 years ago
Jordi Boggiano dc84dbbbf7
Fixed detection of hg version when localized, fixes #9753 4 years ago
Jordi Boggiano 53a974f9c9
Tweak virtualbox detection and improve it by detecting vbox additions, refs #9627 4 years ago
Jordi Boggiano 836ca051d3
Merge branch '1.10' into 2.0 4 years ago
Jordi Boggiano 96acad1e45
Update github token pattern to match their latest updates 4 years ago
Jordi Boggiano bf73a20bc0
Merge branch '2.0' 4 years ago
Stephan 2f4b99eacd
MaxFileSizeException should reject download job (#9778) 4 years ago
Jordi Boggiano 346356a4dd
Fix phpdoc 4 years ago
Jordi Boggiano 5d6f9b2528
Prefer @phpstan- annotations as that is what we run against 4 years ago
Jordi Boggiano b40b93bc7d
Merge branch '2.0' 4 years ago
Jordi Boggiano 414586ba05
Attempt working around Vagrant filesystem issues, added COMPOSER_RUNTIME_ENV env var (set to vagrant), fixes #9627 4 years ago
Jordi Boggiano 059b5b197d
Merge branch '2.0' 4 years ago
Jordi Boggiano c81562b343
Merge branch '1.10' into 2.0 4 years ago
Jordi Boggiano 54889ca109
Document GH token usage and also make sure we redact them in Process debug output, refs #9757 4 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, ..
4 years ago
Jordi Boggiano d0b399b788
Merge branch '2.0' 4 years ago
John Stevenson 4f47a4c667
Proxy handling docs and tweaks (#9735) 4 years ago
Jordi Boggiano 40800df6bd
Fix CS 4 years ago
Markus Staab a5fecc4720
Filesystem: added removeDirectoryAsync() and use it in ArchiveDownloader (#9618)
This turns half of the `rm -rf ...` executions during package installs async and therefore improves performance
4 years ago
Jordi Boggiano bbd87934e9
Make sure we always pass a string to strtoupper 4 years ago
Jordi Boggiano 31d9f51572
Auto-detect mingw and assume it is interactive, fixes #9690 4 years ago