Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77ee866

Browse files
[php7] Fix for substr() always returning a string
1 parent 633d0d8 commit 77ee866

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Symfony/Component/Console/Input/ArgvInput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ private function addLongOption($name, $value)
215215

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

218-
// Convert false values (from a previous call to substr()) to null
219-
if (false === $value) {
218+
// Convert empty values to null
219+
if (!isset($value[0])) {
220220
$value = null;
221221
}
222222

src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ public function testNotice()
121121
$that->assertEquals('->', $trace[0]['type']);
122122

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

128-
$that->assertEquals(__CLASS__, $trace[2]['class']);
128+
$that->assertEquals('Symfony\Component\Debug\Tests\ErrorHandlerTest', $trace[2]['class']);
129129
$that->assertEquals('testNotice', $trace[2]['function']);
130130
$that->assertEquals('->', $trace[2]['type']);
131131
};

src/Symfony/Component/Yaml/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
320320
return;
321321
}
322322

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

0 commit comments

Comments
 (0)