From b665d267c3ed984c9ccdb8b2dda55321a4972c92 Mon Sep 17 00:00:00 2001 From: vladar Date: Fri, 25 Nov 2016 16:35:46 +0700 Subject: [PATCH] Changed scope of Schema props (and some others) to `private` --- src/Schema.php | 29 +++++++++-------------------- src/Type/Definition/NonNull.php | 2 +- src/Type/SchemaValidator.php | 2 +- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/Schema.php b/src/Schema.php index b08e14f..b8c8a62 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -44,37 +44,37 @@ class Schema /** * @var ObjectType */ - protected $queryType; + private $queryType; /** * @var ObjectType */ - protected $mutationType; + private $mutationType; /** * @var ObjectType */ - protected $subscriptionType; + private $subscriptionType; /** * @var Directive[] */ - protected $directives; + private $directives; /** * @var Type[] */ - protected $typeMap; + private $typeMap; /** * @var array */ - protected $implementations; + private $implementations; /** * @var array> */ - protected $possibleTypeMap; + private $possibleTypeMap; /** * Schema constructor. @@ -103,7 +103,7 @@ class Schema /** * @param array $config */ - protected function init(array $config) + private function init(array $config) { $config += [ 'query' => null, @@ -294,20 +294,9 @@ class Schema /** * @param $type - * @deprecated since 17.10.2016 in favor of $this->extractTypes * @return array */ - protected function _extractTypes($type) - { - trigger_error(__METHOD__ . ' is deprecated in favor of ' . __CLASS__ . '::extractTypes', E_USER_DEPRECATED); - return $this->extractTypes($type); - } - - /** - * @param $type - * @return array - */ - protected function extractTypes($type) + private function extractTypes($type) { if (!$type) { return $this->typeMap; diff --git a/src/Type/Definition/NonNull.php b/src/Type/Definition/NonNull.php index cbdceb3..2e1c106 100644 --- a/src/Type/Definition/NonNull.php +++ b/src/Type/Definition/NonNull.php @@ -14,7 +14,7 @@ class NonNull extends Type implements WrappingType, OutputType, InputType /** * @var callable|Type */ - protected $ofType; + private $ofType; /** * @param callable|Type|DefinitionContainer $type diff --git a/src/Type/SchemaValidator.php b/src/Type/SchemaValidator.php index af118b2..72aecae 100644 --- a/src/Type/SchemaValidator.php +++ b/src/Type/SchemaValidator.php @@ -193,7 +193,7 @@ class SchemaValidator * @param InterfaceType $iface * @throws \Exception */ - protected static function assertObjectImplementsInterface(Schema $schema, ObjectType $object, InterfaceType $iface) + private static function assertObjectImplementsInterface(Schema $schema, ObjectType $object, InterfaceType $iface) { $objectFieldMap = $object->getFields(); $ifaceFieldMap = $iface->getFields();