521 Commits (3fa7a6cb5104cc2235a767ee7b2df1475c4763a0)

Author SHA1 Message Date
Martin Herndl 995bf5a932
Add types to `Util` namespace, refs #10159 (#10190) 3 years ago
Jordi Boggiano d1c8a4d1b4
Lots of typing improvements 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
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
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 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 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 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 e7f6dd287c
Merge branch '1.10' 3 years ago
Jordi Boggiano abcf9e993b
Fix processes silently ignoring the CWD when it does not exist, refs #9694 3 years ago
Jordi Boggiano b7d770659b
CS fixes 4 years ago
Jordi Boggiano abd61369e4
Revert "Support git@bitbucket.org URLs for git-bitbucket driver", fixes #9400
This reverts commit 985cef790f.
4 years ago
Jordi Boggiano 985cef790f
Support git@bitbucket.org URLs for git-bitbucket driver 4 years ago
Jordi Boggiano 8ad33298ff
Fix regression, refs #9204 4 years ago
Simon Berger 2223b93efd Several small code improvements 4 years ago
Simon Berger 80d71ccb3f Merged isset, unset and str_replace calls 4 years ago
Simon Berger 80a75e9959 Minor code improvements 4 years ago
Simon Berger a6475a7118 Removed unused variables, properties and parameters of private functions 4 years ago
Simon Berger cda6e8bea6 Removed unnecessary property initialization or declaration 4 years ago
Simon Berger 6b3b51e299 Fixed $this usage on static functions 4 years ago
Jordi Boggiano c3db4614c9
Also remove credentials from cache dirs in git/svn drivers, fixes #7439, refs #9155 4 years ago
Jordi Boggiano 90332f1dbd
Add a readonly mode to the cache, fixes #9150 4 years ago
Jordi Boggiano 2d3905157d
Merge branch '1.10' 4 years ago
Jordi Boggiano 79813b2f77
Fix detection of git refs to be more strict 4 years ago
Stephan b25296ef74 Driver: only cache composer.json file without API data to disk 4 years ago
Jordi Boggiano 92ef439666
Merge branch '1.10' 4 years ago
Jordi Boggiano d2d3aa8494
Fix parsing of # in funding links, fixes composer/packagist#1097, closes #9035 4 years ago
Jordi Boggiano 821e575658
Merge branch '1.10' 4 years ago
Stephan Vock 52332d994e GitDriver: use authentication for supports check 4 years ago
Jordi Boggiano c8731598cc
Merge branch '1.10' 4 years ago
Graham Campbell fa799970ad Replace whitelist with allow list 4 years ago
Jordi Boggiano a4a617abb4
Reduce amount of Filesystem/ProcessExecutor instantiations, add lots of docblocks 4 years ago
Jordi Boggiano aa6be02c64
Allow COMPOSER_DISABLE_NETWORK to work with GitHubDriver by doing a cache priming pass first 4 years ago
Adam Žurek 25cd2382cb
Raise phpstan level to 1 (#8027) 4 years ago
Jordi Boggiano e15f7d6bb7
Merge branch 'master' into 2.0 4 years ago
Stephan 402c64c271
Update src/Composer/Repository/Vcs/GitLabDriver.php
Co-Authored-By: Jordi Boggiano <j.boggiano@seld.be>
4 years ago
Stephan Vock 55d252b9c3 GitLab: properly handle token which has Guest only access 4 years ago
Jordi Boggiano 80875e896d
Merge branch 'master' into 2.0 4 years ago
Jordi Boggiano 05737a46fb
Improve funding info parsing 4 years ago
Jordi Boggiano 9cab8c10cc
Merge branch 'master' into 2.0 4 years ago
Jordi Boggiano c4f19e51d8
Rework the funding info parsing to avoid requiring graphql permissions 4 years ago
Jordi Boggiano 2e82e34fe0
Merge branch 'master' into 2.0 4 years ago
Jordi Boggiano 4f59162827
Fix class name of caught exception 4 years ago
Jordi Boggiano 0ad322e51f
Fix tests 4 years ago
Jordi Boggiano bc002ae1fb
Merge branch 'master' into 2.0 4 years ago
Jordi Boggiano 8dc055bec7
Fix 5.3 syntax 4 years ago