public function testIsInputType() { $testType = new ObjectType(['name' => 'test', 'fields' => ['name' => new StringType()]]); $this->assertTrue(TypeService::isInputType(new StringType())); $this->assertTrue(TypeService::isInputType(TypeMap::TYPE_STRING)); $this->assertFalse(TypeService::isInputType('invalid type')); $this->assertFalse(TypeService::isInputType($testType)); }
private function isInputField($data) { if (is_object($data)) { if ($data instanceof InputFieldInterface) { return true; } else { return TypeService::isInputType($data); } } else { if (!isset($data['type'])) { return false; } return TypeService::isInputType($data['type']); } }