resolve() публичный статический Метод

public static resolve ( $type ) : mixed
$type
Результат mixed
Пример #1
0
 public function getType()
 {
     if (null === $this->resolvedType) {
         $this->resolvedType = Type::resolve($this->type);
     }
     return $this->resolvedType;
 }
Пример #2
0
 /**
  * @return ObjectType[]
  */
 public function getTypes()
 {
     if (null === $this->types) {
         if ($this->config['types'] instanceof \Closure) {
             $types = call_user_func($this->config['types']);
         } else {
             $types = $this->config['types'];
         }
         Utils::invariant(is_array($types), 'Option "types" of union "%s" is expected to return array of types (or closure returning array of types)', $this->name);
         $this->types = [];
         foreach ($types as $type) {
             $this->types[] = Type::resolve($type);
         }
     }
     return $this->types;
 }
Пример #3
0
 /**
  * @param bool $recurse
  * @return mixed
  */
 public function getWrappedType($recurse = false)
 {
     $type = Type::resolve($this->ofType);
     return $recurse && $type instanceof WrappingType ? $type->getWrappedType($recurse) : $type;
 }
Пример #4
0
 /**
  * @return Type
  */
 public function getWrappedType()
 {
     return Type::resolve($this->ofType);
 }
Пример #5
0
 /**
  * @param bool $recurse
  * @return mixed
  * @throws \Exception
  */
 public function getWrappedType($recurse = false)
 {
     $type = Type::resolve($this->ofType);
     Utils::invariant(!$type instanceof NonNull, 'Cannot nest NonNull inside NonNull');
     return $recurse && $type instanceof WrappingType ? $type->getWrappedType($recurse) : $type;
 }
Пример #6
0
 /**
  * @return Type
  */
 public function getType()
 {
     if (null === $this->resolvedType) {
         // TODO: deprecate types as callbacks - instead just allow field definitions to be callbacks
         $this->resolvedType = Type::resolve($this->type);
     }
     return $this->resolvedType;
 }
Пример #7
0
 public function getType()
 {
     return Type::resolve($this->type);
 }
Пример #8
0
 /**
  * @param InterfaceType $iface
  * @return bool
  */
 public function implementsInterface($iface)
 {
     $iface = Type::resolve($iface);
     return !!Utils::find($this->getInterfaces(), function ($implemented) use($iface) {
         return $iface === $implemented;
     });
 }
Пример #9
0
 /**
  * @return Type|callable
  */
 public function getWrappedType()
 {
     $type = Type::resolve($this->ofType);
     Utils::invariant(!$type instanceof NonNull, 'Cannot nest NonNull inside NonNull');
     return $type;
 }