Merge pull request #10051 from jrfnl/feature/php-8.1-null-to-non-nullable-fix-1
PHP 8.1: prevent a "null to non-nullable" deprecation notice [1]pull/10065/head
commit
052065028f
|
@ -594,7 +594,10 @@ class Package extends BasePackage
|
||||||
|
|
||||||
// only bitbucket, github and gitlab have auto generated dist URLs that easily allow replacing the reference in the dist URL
|
// only bitbucket, github and gitlab have auto generated dist URLs that easily allow replacing the reference in the dist URL
|
||||||
// TODO generalize this a bit for self-managed/on-prem versions? Some kind of replace token in dist urls which allow this?
|
// TODO generalize this a bit for self-managed/on-prem versions? Some kind of replace token in dist urls which allow this?
|
||||||
if (preg_match('{^https?://(?:(?:www\.)?bitbucket\.org|(api\.)?github\.com|(?:www\.)?gitlab\.com)/}i', $this->getDistUrl())) {
|
if (
|
||||||
|
$this->getDistUrl() !== null
|
||||||
|
&& preg_match('{^https?://(?:(?:www\.)?bitbucket\.org|(api\.)?github\.com|(?:www\.)?gitlab\.com)/}i', $this->getDistUrl())
|
||||||
|
) {
|
||||||
$this->setDistReference($reference);
|
$this->setDistReference($reference);
|
||||||
$this->setDistUrl(preg_replace('{(?<=/|sha=)[a-f0-9]{40}(?=/|$)}i', $reference, $this->getDistUrl()));
|
$this->setDistUrl(preg_replace('{(?<=/|sha=)[a-f0-9]{40}(?=/|$)}i', $reference, $this->getDistUrl()));
|
||||||
} elseif ($this->getDistReference()) { // update the dist reference if there was one, but if none was provided ignore it
|
} elseif ($this->getDistReference()) { // update the dist reference if there was one, but if none was provided ignore it
|
||||||
|
|
Loading…
Reference in New Issue