Check input data

@param  mixed $input

@return bool
166261
public function validate($input): bool
    {
        if ($input instanceof DateTime) {
            return true;
        }

        if (!\is_string($input)) {
            return false;
        }

        if (null === $this->format) {
            return false !== strtotime($input);
        }

        $dateFromFormat = DateTime::createFromFormat($this->format, $input);

        return $dateFromFormat
            && $input === date($this->format, $dateFromFormat->getTimestamp());
    }
331650
public function verifyHash($input)
    {
        $salt = substr($input, 0, strrpos($input, '$') + 1);
        $checksum = substr($input, strrpos($input, '$') + 1);

        return ($this->verifySalt($salt) && 1 === preg_match('/^[\.\/0-9A-Za-z]{28}$/', $checksum));
    }
560045
protected function isUpdate($input)
    {
        return (isset($input[$this->id_name]) && ! empty($input[$this->id_name]) );
    }
871306
public function sanitize($input = false) {

        if($input) {

            if(Validate::isArray($input)) {

                return filter_var_array($input,FILTER_SANITIZE_STRING);
            } 
            if(Validate::isString($input)) {
                
                return filter_var($input, FILTER_SANITIZE_STRING);
            } 
        }

        return false;
    }
241251
protected function isId($input)
    {
        // Assume false result
        $result = false;

        // Make the search easier
        $input = strtolower($input);

        // We got the Id field if the first 2 or the last 2 characters are === id (e.g. IdMessages, MessageId, Id, ...)
        if (substr($input, 0, 2) === 'id' || substr($input, -2, 2) === 'id') {
            $result = true;
        }

        return $result;
    }
22761
public function validateMobile($input)
    {
        $mobile = $this->cache->get($this->sessionKey . 'mobile');
        $valid = strcasecmp($mobile, $input) === 0;
        return $valid;
    }
716323
public function verifySalt($input)
    {
        $regex = '/^\$sha1\$(\d{1,10})\$([\.\/0-9A-Za-z]{0,64})\$?$/';
        $matches = array ();

        $appearsValid = (1 === preg_match($regex, $input, $matches));
        if ($appearsValid) {
            $rounds = (int) $matches[1];
            $salt = $matches[2];

            if (!empty ($matches[1]) && ($rounds < 1 || $rounds > 4294967295)) {
                $appearsValid = false;
            }
        }

        return $appearsValid;
    }
37880
private function getOutput($input)
	{
		$return = Api::decrypt($this->createkey() , $input);
		if (!is_array($return)) {
			ob_start();
			$return = json_decode(trim(base64_decode($input)), true);
			ob_end_clean();
		}
		if (!is_array($return)) {
			$this->error[] = 'JfusionAPI: error output: ' . $input;
			return false;
		} else if (isset($return['PHPSESSID'])) {
			$this->sid = $return['PHPSESSID'];
		}

		if (isset($return['debug'])) {
			$this->debug = $return['debug'];
		}
		if (isset($return['error']) && !empty($return['error'])) {
			return false;
		} else if (isset($return['payload'])) {
			return $return['payload'];
		}
		return true;
	}
130163
public function validateRegexp(string $input): bool
    {
        $output = true;
        set_error_handler(function (int $severity, string $message) use (&$output) {
            if (strpos($message, 'preg_replace(): ') === 0) {
                $output = false;
            } else {
                return false;
            }
        }, E_WARNING | E_DEPRECATED);
        preg_replace($input, '', '');
        restore_error_handler();
        return $output
            ? preg_match("/^\\/[^\\p{C}\\p{Z}\\p{M}A-Zァ-ヶ\u{10000}-\u{10FFFD}]+\\/$/u", $input) === 1
            : false;
    }
984899
public function check(array $input)
    {
        $missing = [];
        $invalid = [];

        $check = function ($constraint, $key, $value, $input) use (
            &$missing,
            &$invalid
        ) {
            if ($constraint instanceof AbstractConstraint) {
                if (!$constraint->check($value, $input)) {
                    $invalid[$key][] = $constraint;
                }
            } elseif ($constraint instanceof CheckableInterface) {
                $result = $constraint->check($value);

                $missing = Std::concat(
                    $missing,
                    array_map(
                        function ($subKey) use ($key) {
                            return vsprintf('%s.%s', [$key, $subKey]);
                        },
                        $result->getMissing()
                    )
                );

                foreach ($result->getFailed() as $failedField => $constraints) {
                    $fullPath = vsprintf('%s.%s', [$key, $failedField]);

                    if (array_key_exists($fullPath, $invalid)) {
                        $invalid[$fullPath] = array_merge(
                            $invalid[$fullPath],
                            $constraints
                        );
                    } else {
                        $invalid[$fullPath] = $constraints;
                    }
                }
            } else {
                throw new CoreException(
                    vsprintf(
                        'Unexpected constraint type: %s.',
                        [
                            TypeHound::fetch($constraint),
                        ]
                    )
                );
            }
        };

        $inputMap = ArrayMap::of($input);

        $this->annotations->each(
            function ($value, $key) use (
                $check,
                $input,
                $inputMap,
                &$missing
            ) {
                // If a field is required but not present, we should report it.
                if (Maybe::fromMaybe(
                        false,
                        $value->lookup(static::ANNOTATION_REQUIRED)
                    )
                    && $inputMap->member($key) === false
                ) {
                    $missing[] = $key;

                    // There's no point on checking constraints on the field
                    // since it is missing.
                    return;
                } elseif ($inputMap->member($key) === false) {
                    // There's no point on checking constraints on the field
                    // since it is missing.
                    return;
                }

                $fieldValue = Maybe::fromJust($inputMap->lookup($key));

                $this
                    ->getInternalFieldConstraints($key)
                    ->each(
                        function ($constraint) use (
                            $check,
                            $key,
                            $fieldValue,
                            $input
                        ) {
                            $check($constraint, $key, $fieldValue, $input);
                        }
                    );
            }
        );

        if (count($missing) === 0 && count($invalid) === 0) {
            return new SpecResult($missing, $invalid, SpecResult::STATUS_PASS);
        }

        return new SpecResult($missing, $invalid, SpecResult::STATUS_FAIL);
    }
360538
private function _is_balanced($input) {
    $balance = 0;

    foreach ( str_split($input) as $char ) {
      if ( $char == '(' ) {
        $balance++;
      } else if ( $char == ')' ) {
        $balance--;
      }

      // found a close paren without a matching open paren,
      // no need to continue further
      if ( $balance < 0 ) {
        break;
      }
    }

    return $balance === 0;
  }
1209775
public function isValidLocalParameterArray($input)
    {
        //====================================================================//
        // Verify Array Given
        if (!is_array($input)) {
            return Splash::log()->err(Splash::trans('ErrorCfgNotAnArray', get_class($input)));
        }

        //====================================================================//
        // Required Parameters are Available
        //====================================================================//
        if (!array_key_exists('WsIdentifier', $input)) {
            return Splash::log()->err(Splash::trans('ErrWsNoId'));
        }

        if (!array_key_exists('WsEncryptionKey', $input)) {
            return Splash::log()->err(Splash::trans('ErrWsNoKey'));
        }

        return true;
    }
1291660
protected function checkIsNull($input) {
		$isNull = $this->isNull;
		if($isNull)
			return $isNull($input);
		else
			return $input === null || $input === '';
	}
957189
private function parseValue($input)
    {
        if (is_array($input)) {

        } elseif (substr($input, 0, 1) === '"' && substr($input, -1) === '"') {
            $input = substr($input, 1, -1);
        } elseif (strpos($input, "|") !== false) {
            $input = explode("|", $input);
            foreach ($input as $key => $value) {
                $input[$key] = $this->parseValue($value);
            }
        } elseif ($input === "false") {
            $input = false;
        } elseif ($input === "true") {
            $input = true;
        } elseif (is_numeric($input)) {
            if (strpos($input, ".") !== false) {
                $input = (float)$input;
            } else {
                $input = (int)$input;
            }
        } elseif ($input === "on") {
            $input = true;
        }

        return $input;
    }
600538
public function validate($input): bool
    {
        if (\is_array($this->haystack)) {
            return \in_array($input, $this->haystack, false);
        }

        if (!\is_string($this->haystack)) {
            return false;
        }

        if (empty($input)) {
            return false;
        }

        $enc = mb_detect_encoding($input);

        return mb_stripos($this->haystack, $input, 0, $enc) !== false;
    }
505615
public function validate($input): bool
    {
        if ($this->areAggregatorsDirty() === true) {
            $this->resetAggregators();
        }

        $this->validateSingleImplementation($input, $this->getCaptureAggregator(), $this->getErrorAggregator());
        $this->markAggregatorsAsDirty();

        $noErrors = $this->getErrorAggregator()->count() <= 0;

        return $noErrors;
    }
178827
public function match($input)
    {
        if (!is_string($input)) {
            throw new \InvalidArgumentException(
                'Invalid argument. Expected a string, received ' . gettype($input)
            );
        }

        return (bool) preg_match('/' . $this->getRule() . '/ms', strtolower($input));
    }