Skip to content

Commit

Permalink
[php7] Fix for substr() always returning a string
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jul 28, 2015
1 parent 633d0d8 commit 77ee866
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Input/ArgvInput.php
Expand Up @@ -215,8 +215,8 @@ private function addLongOption($name, $value)

$option = $this->definition->getOption($name);

// Convert false values (from a previous call to substr()) to null
if (false === $value) {
// Convert empty values to null
if (!isset($value[0])) {
$value = null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
Expand Up @@ -121,11 +121,11 @@ public function testNotice()
$that->assertEquals('->', $trace[0]['type']);

$that->assertEquals(__FILE__, $trace[1]['file']);
$that->assertEquals(__CLASS__, $trace[1]['class']);
$that->assertEquals('Symfony\Component\Debug\Tests\ErrorHandlerTest', $trace[1]['class']);
$that->assertEquals('triggerNotice', $trace[1]['function']);
$that->assertEquals('::', $trace[1]['type']);

$that->assertEquals(__CLASS__, $trace[2]['class']);
$that->assertEquals('Symfony\Component\Debug\Tests\ErrorHandlerTest', $trace[2]['class']);
$that->assertEquals('testNotice', $trace[2]['function']);
$that->assertEquals('->', $trace[2]['type']);
};
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Yaml/Parser.php
Expand Up @@ -320,7 +320,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
return;
}

if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) {
if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) {
// the previous line contained a dash but no item content, this line is a sequence item with the same indentation
// and therefore no nested list or mapping
$this->moveToPreviousLine();
Expand Down

0 comments on commit 77ee866

Please sign in to comment.