composer update
This commit is contained in:
@@ -64,7 +64,7 @@ abstract class AbstractVariables implements VariablesInterface
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
protected abstract function getInternal($name);
|
||||
abstract protected function getInternal($name);
|
||||
|
||||
/**
|
||||
* Set an environment variable.
|
||||
@@ -100,7 +100,7 @@ abstract class AbstractVariables implements VariablesInterface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected abstract function setInternal($name, $value = null);
|
||||
abstract protected function setInternal($name, $value = null);
|
||||
|
||||
/**
|
||||
* Clear an environment variable.
|
||||
@@ -132,7 +132,7 @@ abstract class AbstractVariables implements VariablesInterface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected abstract function clearInternal($name);
|
||||
abstract protected function clearInternal($name);
|
||||
|
||||
/**
|
||||
* Determine if the environment is immutable.
|
||||
|
||||
+7
-15
@@ -22,7 +22,7 @@ class Lines
|
||||
foreach ($lines as $line) {
|
||||
list($multiline, $line, $multilineBuffer) = self::multilineProcess($multiline, $line, $multilineBuffer);
|
||||
|
||||
if (!$multiline && !self::isComment($line) && self::isSetter($line)) {
|
||||
if (!$multiline && !self::isCommentOrWhitespace($line)) {
|
||||
$output[] = $line;
|
||||
}
|
||||
}
|
||||
@@ -115,28 +115,20 @@ class Lines
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the line in the file is a comment, e.g. begins with a #.
|
||||
* Determine if the line in the file is a comment or whitespace.
|
||||
*
|
||||
* @param string $line
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private static function isComment($line)
|
||||
private static function isCommentOrWhitespace($line)
|
||||
{
|
||||
if (trim($line) === '') {
|
||||
return true;
|
||||
}
|
||||
|
||||
$line = ltrim($line);
|
||||
|
||||
return isset($line[0]) && $line[0] === '#';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given line looks like it's setting a variable.
|
||||
*
|
||||
* @param string $line
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private static function isSetter($line)
|
||||
{
|
||||
return strpos($line, '=') !== false;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ class Parser
|
||||
if ($char === $value[0] || $char === '\\') {
|
||||
return [$data[0].$char, self::QUOTED_STATE];
|
||||
} elseif (in_array($char, ['f', 'n', 'r', 't', 'v'], true)) {
|
||||
return [$data[0].stripcslashes('\\' . $char), self::QUOTED_STATE];
|
||||
return [$data[0].stripcslashes('\\'.$char), self::QUOTED_STATE];
|
||||
} else {
|
||||
throw new InvalidFileException(
|
||||
self::getErrorMessage('an unexpected escape sequence', $value)
|
||||
|
||||
+6
-4
@@ -50,7 +50,6 @@ class Validator
|
||||
'is missing'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,6 +132,10 @@ class Validator
|
||||
{
|
||||
return $this->assertCallback(
|
||||
function ($value) use ($choices) {
|
||||
if ($value === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return in_array($value, $choices, true);
|
||||
},
|
||||
sprintf('is not one of [%s]', implode(', ', $choices))
|
||||
@@ -151,15 +154,14 @@ class Validator
|
||||
public function allowedRegexValues($regex)
|
||||
{
|
||||
return $this->assertCallback(
|
||||
function ($value) use ($regex)
|
||||
{
|
||||
function ($value) use ($regex) {
|
||||
if ($value === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return Regex::match($regex, $value)->success()->getOrElse(0) === 1;
|
||||
},
|
||||
sprintf('does not match "%s"' , $regex)
|
||||
sprintf('does not match "%s"', $regex)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user