PHP 5.3 does not support $this in closures. Nested reuse of identical variables separated.
parent
868e607f17
commit
98845dca6f
|
@ -79,10 +79,11 @@ class JsonConfigSource implements ConfigSourceInterface
|
|||
*/
|
||||
public function addConfigSetting($name, $value)
|
||||
{
|
||||
$this->manipulateJson('addConfigSetting', $name, $value, function (&$config, $key, $val) {
|
||||
$that = $this;
|
||||
$this->manipulateJson('addConfigSetting', $name, $value, function (&$config, $key, $val) use ($that) {
|
||||
if (preg_match('{^(github-oauth|gitlab-oauth|http-basic|platform)\.}', $key)) {
|
||||
list($key, $host) = explode('.', $key, 2);
|
||||
if ($this->authConfig) {
|
||||
if ($that->authConfig) {
|
||||
$config[$key][$host] = $val;
|
||||
} else {
|
||||
$config['config'][$key][$host] = $val;
|
||||
|
@ -98,10 +99,11 @@ class JsonConfigSource implements ConfigSourceInterface
|
|||
*/
|
||||
public function removeConfigSetting($name)
|
||||
{
|
||||
$this->manipulateJson('removeConfigSetting', $name, function (&$config, $key) {
|
||||
$that = $this;
|
||||
$this->manipulateJson('removeConfigSetting', $name, function (&$config, $key) use ($that) {
|
||||
if (preg_match('{^(github-oauth|gitlab-oauth|http-basic|platform)\.}', $key)) {
|
||||
list($key, $host) = explode('.', $key, 2);
|
||||
if ($this->authConfig) {
|
||||
if ($that->authConfig) {
|
||||
unset($config[$key][$host]);
|
||||
} else {
|
||||
unset($config['config'][$key][$host]);
|
||||
|
|
|
@ -175,10 +175,10 @@ class RootPackageLoader extends ArrayLoader
|
|||
|
||||
// extract all sub-constraints in case it is an OR/AND multi-constraint
|
||||
$orSplit = preg_split('{\s*\|\|?\s*}', trim($reqVersion));
|
||||
foreach ($orSplit as $constraint) {
|
||||
$andSplit = preg_split('{(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)}', $constraint);
|
||||
foreach ($andSplit as $constraint) {
|
||||
$constraints[] = $constraint;
|
||||
foreach ($orSplit as $orConstraint) {
|
||||
$andSplit = preg_split('{(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)}', $orConstraint);
|
||||
foreach ($andSplit as $andConstraint) {
|
||||
$constraints[] = $andConstraint;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue