541 Commits (0db443ba5f3a0a19081f7944ba988a32db2e7490)

Author SHA1 Message Date
Jordi Boggiano 0db443ba5f
Add visibility to all consts, fixes #10550 2 years ago
Jordi Boggiano 7abc8da7d3
Add more types 2 years ago
Jordi Boggiano 6da38f83a0
Add parameter types to all the things 2 years ago
Alexander Schranz 1321bfca36
Add return types to closures (#9) 2 years ago
Jordi Boggiano eda9014bef
Add return types to all code which is not being extended by open source packages 2 years ago
Jordi Boggiano a16ed3d0ed
Add return types to private/internal methods 2 years ago
Jordi Boggiano abdc6893a6
Add void types where no return statement is present 2 years ago
Jordi Boggiano 32852304d0
Make use of some new PHP features 2 years ago
Stephan 3eb12efae5
VcsRepositories: handle initialize with invalid repository URL (#10525) 2 years ago
Jordi Boggiano e3d99cac59
Fix phpstan issues, update baseline and pin PHPStan version in 2.2 branch (#10474) 2 years ago
Stephan 9360e2c18a
GitLab: detect repository functionality disabled in Driver (#10440) 3 years ago
Jérôme Tamarelle f0060b7f56
Use web URLs for Gitlab support metadata (#10377) 3 years ago
Jordi Boggiano 24ce1eddbd
Add composer/pcre dependency and use it everywhere instead of preg_* 3 years ago
Stephan f5ffedfe60
Fix VcsDrivers initialization of tags and branches, and VcsRepository swallowing exceptions (#10319)
* Drivers: avoid early initialize of tags and branches

* VcsRepository: do not continue if fetching root information fails because of unexpected exceptions

Also rethrow 5XX exception in addition to select 4XX exceptions
3 years ago
Jordi Boggiano 68847ed609
Tweak bitbucket driver to uniformize regexes 3 years ago
Jordi Boggiano cda7863f20
Get rid of the abstract BitbucketDriver class, fixes #9856 3 years ago
Raphael de Almeida 150acc5559
Removed HgBitbucketDriver support (#10248) 3 years ago
Jordi Boggiano c65d09dff7
Fix @inheritDoc annotations 3 years ago
Martin Herndl 3645d3042c
Add types to root namespace (#10213) 3 years ago
Anatoly Pashin b1a96a3141
PHPStan level 6 in src/Composer/Repository (#10197) 3 years ago
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