@param string $data

@return bool
327536
public function send(string $data): bool
    {
        $result =  $this->connection->send($data);
        $this->recv = false;
        return $result;
    }
1369800
public static function is($data) {
		if (self::isArray($data)) {
			return 'array';

		} else if (self::isObject($data)) {
			return 'object';

		} else if (self::isJson($data)) {
			return 'json';

		} else if (self::isSerialized($data)) {
			return 'serialized';

		} else if (self::isXml($data)) {
			return 'xml';
		}

		return 'other';
	}
669370
public static function has(array $data, $key)
	{
		if (!is_array($data)) {
			return false;
		}

		if (!array_key_exists($key,$data)) {
			return false;
		}

		return true;
	}
1053309
public function php($data)
    {
        $valid = true;

        // If we want to ignore validation
        if (get_class($this->form->getRequestHandler()->buttonClicked()) === 'FormActionNoValidation') {
            return $valid;
        }

        // validate against form field validators
        $fields = $this->form->Fields();
        foreach ($fields as $field) {
            $valid = ($field->validate($this) && $valid);
        }

        // validate against ZenValidator constraints
        foreach ($this->constraints as $fieldName => $constraints) {
            $field = $this->form->Fields()->dataFieldByName($fieldName);

            if (!$field) {
                continue;
            }

            if ($field->validationApplies()) {
                foreach ($constraints as $constraint) {
                    if (!$constraint->validate($data[$fieldName])) {
                        $this->validationError($fieldName, $constraint->getMessage(), 'required');
                        $valid = false;
                        $this->debug("Validation (".get_class($constraint).") failed for $fieldName with message: " . $constraint->getMessage());
                    }
                }
            }
        }

        return $valid;
    }
383191
public function hasValue($data, $keys)
    {
        if ($this->isKeysEmpty($keys)) {
            return true;
        }
        if (!is_array($keys)) {
            $keys = [$keys];
        }

        $accessor = new Accessor($data);
        $keyCount = count($keys);
        $depth    = 0;
        foreach ($keys as $key) {
            if (($depth + 1 === $keyCount && $accessor->has($key) === false) || $accessor->to($key) === false) {
                return false;
            }

            ++$depth;
        }

        return true;
    }
882663
public function canParse($data)
	{
		$data = trim($data);

		if ($data && strpos($data, '=') === false)
		{
			return false;
		}

		if ((substr($data, 0, 1) == '{') && (substr($data, -1, 1) == '}'))
		{
			return false;
		}

		$obj = @parse_ini_string($data);

		if (!$obj)
		{
			return false;
		}

		return true;
	}
37047
public function write($data) : bool
    {
        $success = false;

        if ($this->isFile() && $this->isWriteable()) {
            $success = file_put_contents($this->realPath, $data) !== false;
        }

        return $success;
    }
1335220
public function write($data)
    {
        if (!$this->connected) {
            if (!$this->connect()) {
                return false;
            }
        }
        return fwrite($this->connection, $data, strlen($data));
    }
253182
protected function isJsonString($data)
    {
        if (!is_string($data) && !is_null($data)) {
            return false;
        }

        // We json_encode here to see if there might be a json_last_error
        json_decode($data, true);
        if (json_last_error() !== JSON_ERROR_NONE) {
            return false;
        }
        return true;
    }
1321688
public static function is_binary_data($data)
    {
        if (preg_match('!!u', $data)) {
            return false;
        }
        $characters = str_split($data);
        foreach ($characters as $character) {
            $ord_value = ord($character);
            if ($ord_value < 0x20 or $ord_value >= 0x7f) {
                return true;
            }
        }
        return false;
    }
526782
public function unserialize($data)
    {
        $this->throwIfTrue(!is_string($data), '$data must be a string');

        set_error_handler($this->getErrorHandler());
        try {
            $unserialized = unserialize($data);
            $this->throwIfTrue($unserialized === false, '$data could not be unserialized');
            return $unserialized;
        } finally {
            restore_error_handler();
        }
    }
1277698
public function process($data = '')
	{
		$this->data = $data;

		$ext = $this->extensionMap->get($this->extension);
		$arr = $ext->load($data)->toArray();

		$this->paramBag = new ParamBag($arr);

		return true;
	}
404855
public function sendData($data)
    {
        if (is_array($data) && count($data)) {
            $class = $this->getResponseClass();

            return $this->response = new $class($this, $data);
        }

        return false;
    }
397719
public function decode(string $data)
    {
        if (serialize(false) == $data) {
            return false;
        } elseif (false !== ($ret = @unserialize($data))) {
            return $ret;
        } else {
            throw new DecodeException('unserialize() error');
        }
    }
335808
private function isArrayResourceData($data)
    {
        if (!is_array($data) || empty($data)) {
            return false;
        }
        foreach ($data as $datum) {
            if (!$this->isResourceData($datum)) {
                return false;
            }
        }

        return true;
    }
73044
public static function valid($data)
    {
        $rules = [
            'body' => 'required|min:3',
            'post_id' => 'required|min:1|integer|exists:forum_posts,id',
            'author_id' => 'required|min:1|integer|exists:users,id'
        ];
        $validator = Validator::make($data, $rules);

        if ($validator->passes()) {
            return true;
        }
        return false;
    }
764286
public static function isList(array $data): bool
    {
        $isList = true;
        if (count($data) > 0) {
            for ($c1 = 0; $c1 < count($data); $c1++) {
                if (!isset($data[$c1])) {
                    $isList = false;
                }
            }
        }
        return $isList;
    }