Note about dunderscore becoming hard error in next version

This commit is contained in:
Vladimir Razuvaev 2017-07-04 13:51:22 +07:00
parent 3e1fc1a922
commit c3db8de9e7
2 changed files with 3 additions and 2 deletions

View File

@ -354,7 +354,8 @@ class Utils
if (!$isIntrospection && isset($name[1]) && $name[0] === '_' && $name[1] === '_') { if (!$isIntrospection && isset($name[1]) && $name[0] === '_' && $name[1] === '_') {
Warning::warnOnce( Warning::warnOnce(
'Name "'.$name.'" must not begin with "__", which is reserved by ' . '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' 'warnAboutDunder'
); );
} }

View File

@ -61,7 +61,7 @@ class ValidationTest extends \PHPUnit_Framework_TestCase
'name' => '__ReservedName', '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() public function testRejectsAnObjectTypeWithInvalidName()