isInputType() 공개 정적인 메소드

public static isInputType ( mixed | AbstractType $type ) : boolean
$type mixed | AbstractType
리턴 boolean
예제 #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));
 }
예제 #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']);
     }
 }