isInputType() public static method

public static isInputType ( mixed | AbstractType $type ) : boolean
$type mixed | AbstractType
return boolean
Esempio n. 1
0
 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));
 }
Esempio n. 2
0
 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']);
     }
 }