Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.1: fix deprecation warnings about incorrect default values #10036

Merged
merged 4 commits into from Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Composer/Package/Archiver/PharArchiver.php
Expand Up @@ -52,7 +52,12 @@ public function archive($sources, $target, $format, array $excludes = array(), $
$target = $filename . '.tar';
}

$phar = new \PharData($target, null, null, static::$formats[$format]);
$phar = new \PharData(
$target,
\FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO,
'',
static::$formats[$format]
);
$files = new ArchivableFilesFinder($sources, $excludes, $ignoreFilters);
$filesOnly = new ArchivableFilesFilter($files);
$phar->buildFromIterator($filesOnly, $sources);
Expand Down
6 changes: 3 additions & 3 deletions src/Composer/Repository/Vcs/BitbucketDriver.php
Expand Up @@ -86,7 +86,7 @@ protected function getRepoData()
$this->repository,
http_build_query(
array('fields' => '-project,-owner'),
null,
'',
'&'
)
);
Expand Down Expand Up @@ -286,7 +286,7 @@ public function getTags()
'fields' => 'values.name,values.target.hash,next',
'sort' => '-target.date',
),
null,
'',
'&'
)
);
Expand Down Expand Up @@ -330,7 +330,7 @@ public function getBranches()
'fields' => 'values.name,values.target.hash,values.heads,next',
'sort' => '-target.date',
),
null,
'',
'&'
)
);
Expand Down
2 changes: 1 addition & 1 deletion src/Composer/Util/GitLab.php
Expand Up @@ -172,7 +172,7 @@ private function createToken($scheme, $originUrl)
'username' => $username,
'password' => $password,
'grant_type' => 'password',
), null, '&');
), '', '&');
$options = array(
'retry-auth-failure' => false,
'http' => array(
Expand Down
2 changes: 1 addition & 1 deletion src/Composer/Util/NoProxyPattern.php
Expand Up @@ -39,7 +39,7 @@ class NoProxyPattern
*/
public function __construct($pattern)
{
$this->hostNames = preg_split('{[\s,]+}', $pattern, null, PREG_SPLIT_NO_EMPTY);
$this->hostNames = preg_split('{[\s,]+}', $pattern, -1, PREG_SPLIT_NO_EMPTY);
$this->noproxy = empty($this->hostNames) || '*' === $this->hostNames[0];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Composer/Test/AllFunctionalTest.php
Expand Up @@ -181,7 +181,7 @@ public function getTestFiles()

private function parseTestFile($file)
{
$tokens = preg_split('#(?:^|\n*)--([A-Z-]+)--\n#', file_get_contents($file), null, PREG_SPLIT_DELIM_CAPTURE);
$tokens = preg_split('#(?:^|\n*)--([A-Z-]+)--\n#', file_get_contents($file), -1, PREG_SPLIT_DELIM_CAPTURE);
$data = array();
$section = null;

Expand Down
2 changes: 1 addition & 1 deletion tests/Composer/Test/DependencyResolver/PoolBuilderTest.php
Expand Up @@ -175,7 +175,7 @@ public function getIntegrationTests()

protected function readTestFile(\SplFileInfo $file, $fixturesDir)
{
$tokens = preg_split('#(?:^|\n*)--([A-Z-]+)--\n#', file_get_contents($file->getRealPath()), null, PREG_SPLIT_DELIM_CAPTURE);
$tokens = preg_split('#(?:^|\n*)--([A-Z-]+)--\n#', file_get_contents($file->getRealPath()), -1, PREG_SPLIT_DELIM_CAPTURE);

$sectionInfo = array(
'TEST' => true,
Expand Down
2 changes: 1 addition & 1 deletion tests/Composer/Test/InstallerTest.php
Expand Up @@ -484,7 +484,7 @@ public function loadIntegrationTests($path)

protected function readTestFile(\SplFileInfo $file, $fixturesDir)
{
$tokens = preg_split('#(?:^|\n*)--([A-Z-]+)--\n#', file_get_contents($file->getRealPath()), null, PREG_SPLIT_DELIM_CAPTURE);
$tokens = preg_split('#(?:^|\n*)--([A-Z-]+)--\n#', file_get_contents($file->getRealPath()), -1, PREG_SPLIT_DELIM_CAPTURE);

$sectionInfo = array(
'TEST' => true,
Expand Down