Got rid of PHP_EOL usages (we never do or expect carriage returns)

This commit is contained in:
Vladimir Razuvaev 2018-10-10 11:26:48 +02:00
parent 0070cb4039
commit c7fcd4eb48
3 changed files with 4 additions and 7 deletions

View File

@ -53,7 +53,6 @@ use function count;
use function implode; use function implode;
use function is_array; use function is_array;
use function sprintf; use function sprintf;
use const PHP_EOL;
/** /**
* Implements the "Validation" section of the spec. * Implements the "Validation" section of the spec.
@ -316,7 +315,7 @@ class DocumentValidator
if (count($errors) !== 0) { if (count($errors) !== 0) {
throw new Error( throw new Error(
implode( implode(
PHP_EOL . PHP_EOL, "\n\n",
array_map(static function (Error $error) : string { array_map(static function (Error $error) : string {
return $error->message; return $error->message;
}, $errors) }, $errors)

View File

@ -15,7 +15,6 @@ use GraphQL\Type\Schema;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use function count; use function count;
use function var_export; use function var_export;
use const PHP_EOL;
class ValuesTest extends TestCase class ValuesTest extends TestCase
{ {
@ -37,7 +36,7 @@ class ValuesTest extends TestCase
self::assertEquals( self::assertEquals(
$variables, $variables,
$this->runTestCase($variables)['coerced'], $this->runTestCase($variables)['coerced'],
'Output variables did not match input variables' . PHP_EOL . var_export($variables, true) . PHP_EOL 'Output variables did not match input variables' . "\n" . var_export($variables, true) . "\n"
); );
} }

View File

@ -38,7 +38,6 @@ use function iterator_to_array;
use function preg_match; use function preg_match;
use function preg_replace; use function preg_replace;
use function trim; use function trim;
use const PHP_EOL;
class SchemaExtenderTest extends TestCase class SchemaExtenderTest extends TestCase
{ {
@ -1844,9 +1843,9 @@ class SchemaExtenderTest extends TestCase
extend schema @foo extend schema @foo
'), '),
implode( implode(
PHP_EOL, "\n",
array_map(static function ($node) { array_map(static function ($node) {
return Printer::doPrint($node) . PHP_EOL; return Printer::doPrint($node) . "\n";
}, $nodes) }, $nodes)
) )
); );