From c3db8de9e75f6582633143032c8a221f6e84ebbb Mon Sep 17 00:00:00 2001 From: Vladimir Razuvaev Date: Tue, 4 Jul 2017 13:51:22 +0700 Subject: [PATCH] Note about dunderscore becoming hard error in next version --- src/Utils.php | 3 ++- tests/Type/ValidationTest.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Utils.php b/src/Utils.php index d1a2c68..ce3ec61 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -354,7 +354,8 @@ class Utils if (!$isIntrospection && isset($name[1]) && $name[0] === '_' && $name[1] === '_') { Warning::warnOnce( 'Name "'.$name.'" must not begin with "__", which is reserved by ' . - 'GraphQL introspection.', + 'GraphQL introspection. In a future release of graphql this will ' . + 'become an exception', 'warnAboutDunder' ); } diff --git a/tests/Type/ValidationTest.php b/tests/Type/ValidationTest.php index 5ab9eb3..6da5718 100644 --- a/tests/Type/ValidationTest.php +++ b/tests/Type/ValidationTest.php @@ -61,7 +61,7 @@ class ValidationTest extends \PHPUnit_Framework_TestCase 'name' => '__ReservedName', ]); } - ], 'Name "__ReservedName" must not begin with "__", which is reserved by GraphQL introspection.'); + ], 'Name "__ReservedName" must not begin with "__", which is reserved by GraphQL introspection. In a future release of graphql this will become an exception'); } public function testRejectsAnObjectTypeWithInvalidName()