public static function from($object): self
    {
        if ($object instanceof self) {
            return $object;
        }

        if (\is_object($object)) {
            $object = \get_class($object);
        }

        if (! \is_string($object)) {
            throw new InvalidArgumentException('Cannot create a type from '.\gettype($object));
        }

        return new self($object);
    }
public static function from($object): self
    {
        if ($object instanceof self) {
            return $object;
        }

        if (\is_object($object)) {
            $object = \get_class($object);
        }

        if (! \is_string($object)) {
            throw new InvalidArgumentException('Cannot create a type from '.\gettype($object));
        }

        return new self($object);
    }
public static function from ( $ object ) : self { if ( $ object instanceof self ) { return $ object ; } if ( \ is_object ( $ object ) ) { $ object = \ get_class ( $ object ) ; } if ( ! \ is_string ( $ object ) ) { throw new InvalidArgumentException ( 'Cannot create a type from ' . \ gettype ( $ object ) ) ; } return new self ( $ object ) ; }
Create a new Type from an object or a class string.

@param mixed $object

@return Type
Create a new Type from an object or a class string .