From d6dfe9871c4e4e0c2912c8019c75aeccd801a42c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 Jul 2015 17:12:55 +0200 Subject: [PATCH] [php7] Fix for substr() always returning a string --- src/Symfony/Component/Console/Style/SymfonyStyle.php | 2 +- .../Component/VarDumper/Tests/Caster/ReflectionCasterTest.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Console/Style/SymfonyStyle.php b/src/Symfony/Component/Console/Style/SymfonyStyle.php index b3113a41e2..0d366c7e89 100644 --- a/src/Symfony/Component/Console/Style/SymfonyStyle.php +++ b/src/Symfony/Component/Console/Style/SymfonyStyle.php @@ -379,7 +379,7 @@ class SymfonyStyle extends OutputStyle { $chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); - if (false === $chars) { + if (!isset($chars[0])) { return $this->newLine(); //empty history, so we should start with a new line. } //Prepend new line for each non LF chars (This means no blank line was output before) diff --git a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php index ecf776d70f..0fcc7e26bb 100644 --- a/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php @@ -11,8 +11,6 @@ namespace Symfony\Component\VarDumper\Tests\Caster; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; use Symfony\Component\VarDumper\Test\VarDumperTestCase; /** @@ -34,7 +32,7 @@ ReflectionClass { constants: array:3 [ "IS_IMPLICIT_ABSTRACT" => 16 "IS_EXPLICIT_ABSTRACT" => 32 - "IS_FINAL" => 64 + "IS_FINAL" => %d ] properties: array:%d [ "name" => ReflectionProperty {