Determine if the data_type property represents a string value.

@return boolean
762805
public function isString()
    {
        return $this->data_type === PDO::PARAM_STR ||
            $this->data_type === (PDO::PARAM_STR | PDO::PARAM_INPUT_OUTPUT);
    }
593835
public function isValueValid($value) {
		return $value instanceof DataType\TextType || $value instanceof Type\ThingType || $value instanceof DataType\URLType;
	}
894722
private function checkTypes(string $property, $value)
    {
        $integrityConstraints = $this->getIntegritySpecification($property);

        $actualValueType = gettype($value);

        if ($actualValueType == 'double') {
            $actualValueType = is_int($value) ? 'integer' : 'number';
        } else {
            if ($actualValueType == 'NULL') {
                $actualValueType = 'null';
            }
        }

        if (count($integrityConstraints)) {
            // object check
            if ($actualValueType == 'object') {
                if (!in_array(get_class($value), $integrityConstraints)) {
                    throw new PropertyValueNotValidException("Type error: Property [$property] accepts only [".implode(',', $integrityConstraints).'], but given value is instance of : [' . get_class($value).']');
                }
            } else {
                // primitive type value
                $isValidType = false;
                foreach ($integrityConstraints as $type) {
                    if ($type === 'object' && is_object($value)) {
                        $isValidType = true;
                        break;
                    } elseif ($type == 'array' && is_array($value)) {
                        $isValidType = true;
                        break;
                    } elseif ($type == 'string' && is_string($value)) {
                        $isValidType = true;
                        break;
                    } elseif ($type == 'number' && is_numeric($value)) {
                        $isValidType = true;
                        break;
                    } elseif (($type == 'integer' || $type == 'int') && is_int($value)) {
                        $isValidType = true;
                        break;
                    } elseif (($type == 'boolean' || $type == 'bool') && is_bool($value)) {
                        $isValidType = true;
                        break;
                    } elseif ($type == 'null' && $value === null) {
                        $isValidType = true;
                        break;
                    }
                }
                if (!$isValidType) {
                    throw new PropertyValueNotValidException("Type error: Property [$property] accepts only [".implode(',', $integrityConstraints)."], but given value is: [$actualValueType]");
                }
            }
        }

        return true;
    }
915111
public static function isMBString(): bool
    {
        static $isLoaded;

        if (null === $isLoaded) {
            $isLoaded = extension_loaded('mbstring');

            if ($isLoaded) {
                mb_internal_encoding(self::$encoding);
            }
        }

        return $isLoaded;
    }
361012
protected function checkType()
    {
        if (is_scalar($this->format)) {
            return array_key_exists($this->format, $this->patterns);
        } elseif (is_array($this->format)) {
            $pattern = [];
            foreach ($this->format as $f) {
                if (!array_key_exists($f, $this->patterns)) {
                    return false;
                }
                $pattern[] = substr($this->patterns[$f], 2, strlen($this->patterns[$f]) - 4);
            }
            $this->format = 'custom';
            $this->patterns[$this->format] = '/^(' . implode('|', $pattern) . ')$/';

            return true;
        }

        return false;
    }
995446
public final boolean isDatatype( DdlTokenStream tokens ) throws ParsingException {
        // Loop through the registered statement start string arrays and look for exact matches.

        for (String[] stmts : basicCharStringTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicNationalCharStringTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicBitStringTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicExactNumericTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicApproxNumericStringTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicDateTimeTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicMiscTypes) {
            if (tokens.matches(stmts)) return true;
        }

        // If no type is found, assume it's a custom type
        return isCustomDataType(tokens);
    }
440016
public function isValid($value)
    {
        if ($value !== null && !is_string($value) && !is_int($value) && 
            !is_float($value) && !is_bool($value) && !is_array($value) &&
            !is_object($value)
        ) {
            $this->error(self::INVALID);
            return false;
        }
        
        $type = $this->getType();
        $this->setValue($value);
        $object  = false;

        // OBJECT_COUNT (countable object)
        if ($type & self::OBJECT_COUNT) {
            $object = true;

            if (is_object($value) && ($value instanceof \Countable) &&
                (count($value) === 0)) {
                return true;
            }
        }

        // OBJECT_STRING (object's toString)
        if ($type & self::OBJECT_STRING) {
            $object = true;

            if ((is_object($value) && (!method_exists($value, '__toString'))) ||
                (is_object($value) && (method_exists($value, '__toString')) &&
                (((string) $value) === ""))) {
                return true;
            }
        }

        // OBJECT (object)
        if ($type & self::OBJECT) {
            // Fall through. Objects are always considered not empty.
        } elseif ($object === false) {
            // If object not allowed but object given then return false.
            if (is_object($value)) {
                $this->error(self::INVALID);
                return false;
            }
        }

        // SPACE ('   ')
        if ($type & self::SPACE) {
            if (is_string($value) && (preg_match('/^\s+$/s', $value))) {
                return true;
            }
        }

        // NULL (null)
        if ($type & self::NULL) {
            if ($value === null) {
                return true;
            }
        }

        // EMPTY_ARRAY (array())
        if ($type & self::EMPTY_ARRAY) {
            if (is_array($value) && ($value == array())) {
                return true;
            }
        }

        // ZERO ('0')
        if ($type & self::ZERO) {
            if (is_string($value) && ($value == '0')) {
                return true;
            }
        }

        // STRING ('')
        if ($type & self::STRING) {
            if (is_string($value) && ($value == '')) {
                return true;
            }
        }

        // FLOAT (0.0)
        if ($type & self::FLOAT) {
            if (is_float($value) && ($value == 0.0)) {
                return true;
            }
        }

        // INTEGER (0)
        if ($type & self::INTEGER) {
            if (is_int($value) && ($value == 0)) {
                return true;
            }
        }

        // BOOLEAN (false)
        if ($type & self::BOOLEAN) {
            if (is_bool($value) && ($value == false)) {
                return true;
            }
        }

        $this->error(self::IS_NOT_EMPTY);
        return false;
    }
1226012
def _is_text_data(self, data_type):
        """"""
        dt = DATA_TYPES[data_type]
        if type(self.data) is dt['type'] and len(self.data) < dt['max'] and all(type(char) == str for char in self.data):
            self.type = data_type.upper()
            self.len = len(self.data)
            return True
970740
public static function isNumberStr($str)
    {
        return !is_resource($str) && !is_array($str) && !is_object($str) && (is_int($str) || is_numeric($str) || preg_match('/^\d*$/', $str));
    }
1325449
public function isValid()
    {
        $value = $this->field->getValue();

        if (is_array($value) || is_object($value)) {
            throw new \Exception("This validator only works on scalar types!");
        }

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        // now, walk all chars and check if they are in the blacklist
        for ($i = 0; $i < strlen($value); $i++) {
            if (in_array(strval($value[$i]), $this->blacklist, true)) {
                // not in the blacklist!
                return false;
            }
        }

        // if here, everything is ok!
        return true;
    }
1077059
private function isStringDQLQuery($value)
    {
        $keysWord = array(
            "SELECT ",
            " FROM ",
            " WHERE "
        );

        foreach ($keysWord as $keyWord) {
            if (stripos($value, $keyWord) !== false) {
                return true;
            }
        }

        return false;
    }
549433
public static function isStringCastable($value): bool
    {
        $result = false;
        $type = strtolower(gettype($value));
        switch ($type) {
            case 'string':
            case 'null':
            case 'boolean':
            case 'integer':
            case 'double':
                $result = true;
                break;
            case 'object':
                if (method_exists($value, '__toString')) {
                    $result = true;
                }
                break;
            default:
                break;
        }

        return $result;
    }
637621
def _value_is_type_text(val):
    
    if ((u'type' in val.keys()) and
            (val['type'].lower() == u"text")):
        return True
    return False
267837
private function isValid() {
		$data = $this->getTransient();
		$valid = array( 'key', 'cipher', 'iv', 'data' );
		if ( is_object( $data ) ) {
			$props = array_keys( get_object_vars( $data ) );
			$valid = array_diff( $valid, $props );
		}

		return empty( $valid );
	}
856484
public function dataValid()
    {
        foreach (new \RecursiveIteratorIterator($this,
                                                \RecursiveIteratorIterator::SELF_FIRST) as $child) {
            if ($child instanceof FormElement && !$child->dataValid()) {
                return false;
            }
        }

        return true;
    }
501169
public function is_string()
    {
        return isset($this->data[0]) 
                     && sizeof($this->data) == 1 
                     && is_string($this->data[0]);
    }
245408
public boolean isDataValid() {
    boolean valid = false;
    for (Object value : values.values()) {
      if (value instanceof String) {
        String tt = (String) value;
        if (Strings.isNotBlank(tt)) {
          valid = true;
          break;
        }
      } else {
        if (null != value) {
          valid = true;
          break;
        }
      }
    }
    return valid;
  }