@param mixed $var

@return bool|\WP_Error
432105
protected function validate_not_empty( $var ) {
		if ( is_string( $var ) ) {
			$var = trim( $var );
			if ( ! empty( $var ) || '0' === $var ) {
				return true;
			}
		} elseif ( ! empty( $var ) ) {
			return true;
		}

		return new \WP_Error( 400, $this->app->translate( 'Value is required.' ) );
	}
947956
public function toRows($var)
    {
        $results = PHP_EOL;

        foreach ($this->getParser()->toArray() as $name => $types) {
            if (in_array($name, $this->ignores)) {
                continue;
            }

            $results .= Stub::create('/scaffold/row.stub', [
                'label' => ucwords($name),
                'column' => $name,
                'var' => $var,
            ])->render();
        }

        return $results.PHP_EOL;
    }
274596
public static function toPhp($var)
    {
        switch (gettype($var)) {
            case 'array':
                $skipKeys = (range(0, count($var) - 1) === array_keys($var));
                $ret = 'array(';
                $i = 0;
                foreach ($var as $key => $value) {
                    if ($i++ > 0) {
                        $ret .= ', ';
                    }
                    if (!$skipKeys) {
                        $ret .= self::toPhp($key) . ' => ';
                    }
                    $ret .= self::toPhp($value);
                }
                $ret .= ')';
                break;
            default:
                $ret = var_export($var, true);
        }
        return $ret;
    }
1318673
public function routable($var = null)
    {
        if ($var !== null) {
            $this->routable = (bool)$var;
        }

        return $this->routable && $this->published();
    }
785760
protected function decode($var)
    {
        // Try native PECL YAML PHP extension first if available.
        if (\function_exists('yaml_parse') && $this->setting('native', true)) {
            // Safely decode YAML.
            $saved = @ini_get('yaml.decode_php');
            @ini_set('yaml.decode_php', 0);
            $data = @yaml_parse($var);
            @ini_set('yaml.decode_php', $saved);

            if ($data !== false) {
                return (array) $data;
            }
        }

        try {
            return (array) YamlParser::parse($var);
        } catch (ParseException $e) {
            if ($this->setting('compat', true)) {
                return (array) FallbackYamlParser::parse($var);
            }

            throw $e;
        }
    }
1254093
protected function getVarDump($var)
    {
        $varType = gettype($var);
        switch ($varType) {
            case 'boolean':
            case 'integer':
            case 'double':
            case 'NULL':
            case 'ressource':
                return print_r($var, 1);
            case 'string':
                return (250 < strlen($var)) ? substr($var, 0, 250).'...' : $var;
            case 'object':
                return 'Object instance of ' . get_class($var);
            case 'array':
                $formated_array = array();

                foreach ($var as $key => $value) {
                    $formated_array[$key] = $this->getVarDump($value);
                }

                return print_r($formated_array, 1);
        }
    }
433010
protected function validate_confirmation( $var, $target, $request ) {
		$validate = $this->validate_not_empty( $var );
		if ( true === $validate ) {
			$compare = $request->get_param( $target );
			if ( $compare !== $var ) {
				return new \WP_Error( 400, $this->app->translate( 'The confirmation value does not match.' ) );
			}
		}

		return $validate;
	}
392599
public static function isEmpty($var) 
	{	
		$toReturn = false;

		if(is_array($var) && empty($var)) {
			$toReturn = true;
		}

		if(is_string($var) && ($var =='' || is_null($var))) {
			$toReturn = true;
		}

		if(is_integer($var) && ($var =='' || is_null($var)) ) {
			$toReturn = true;
		}

		if(is_float($var) && ($var =='' || is_null($var)) ) {
			$toReturn = true;
		}

		return $toReturn;
	}
916057
private function sanitize($var) {
        $sanitized = strip_tags($var);
        $sanitized = str_replace('http://', '', $sanitized);
        $sanitized = str_replace('https://', '', $sanitized);
        $sanitized = str_replace('../', '', $sanitized);
        $sanitized = str_replace('./', '', $sanitized);
        return $sanitized;
    }
1255700
public static function getAsString($var)
    {
        if ($var instanceof Exception) {
            return (string)$var;
        } elseif (is_object($var)) {
            return self::getObjectAsString($var);
        } elseif (is_array($var)) {
            return print_r($var, true);
        } elseif (is_resource($var)) {
            return (string)sprintf('resource(type=%s)', get_resource_type($var));
        } elseif (true === $var) {
            return 'true';
        } elseif (false === $var) {
            return 'false';
        } elseif (null === $var) {
            return 'null';
        }

        return (string)$var;
    }
551885
public function setValidation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\ParameterValidation::class);
        $this->validation = $var;

        return $this;
    }
615840
public function setFailure(&$var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Etcdserverpb\RequestOp::class);
        $this->failure = $arr;
    }
1152856
public function isInline( $var ) {

		if ( is_object( $var ) ) {
			if ( $var instanceof Element ) {
				return ( in_array( $var->getTag(), $this->inline, true ) );
			}
			return ( strpos( get_class( $var ), 'Pressbooks\HTMLBook\Inline\\' ) !== false );
		}

		if ( is_string( $var ) ) {
			$html5 = new HTML5();
			$dom = $html5->loadHTMLFragment( $var );
			if ( $dom->childNodes->length !== 1 ) {
				return false;
			}
			return ( in_array( $dom->childNodes->item( 0 )->tagName, $this->inline, true ) );
		}

		return false;
	}
162934
protected function validate( $var, $setting ) {
		$validate = $this->validate_not_empty( $var );
		if ( $setting['required'] ) {
			if ( $validate instanceof \WP_Error ) {
				return $validate;
			}
		} else {
			if ( $validate instanceof \WP_Error ) {
				return true;
			}
		}
		switch ( $setting['type'] ) {
			case 'int':
				if ( ! empty( $setting['unsigned'] ) ) {
					return $this->validate_positive_int( $var, true );
				}

				return $this->validate_int( $var );
			case 'float':
			case 'number':
				if ( ! empty( $setting['unsigned'] ) ) {
					return $this->validate_positive_float( $var, true );
				}

				return $this->validate_float( $var );
			case 'bool':
				return true;
			case 'string':
				if ( ! empty( $setting['length'] ) ) {
					return $this->validate_string_length( $var, $setting['length'] );
				}
				break;
		}

		return true;
	}
822976
public function post($var = null)
	{
		$this->id = 0;
		if (!empty($var)) {
			$routing = explode('/', $var);
			if (is_array($routing)) {
				$var = array_shift($routing);
				$this->id = empty($routing)
					? 0
					: array_shift($routing);
			} else {
				$var = $routing;
			}

			if ($this->checkAuth()) {
				// load action based off of naming conventions
				header('Content-Type: application/json');
				return $this->_autoaction($var, 'post');
			} else {
				return $this->getForbbiden($var);
			}
		} else {
			return $this->getNoop();
		}
	}
1115307
public function enable($var): bool
	{
		global $modSettings;

		// This should be extended by somebody else...
		if (empty($this->name) || empty($var))
			return false;

		if (!empty($modSettings[$this->name .'_'. $var]))
			return true;

		else
			return false;
	}
216220
public static function IS_ERROR($value = '') {
		$value		= self::flattenSingleValue($value);

		if (!is_string($value))
			return false;
		return in_array($value, array_values(self::$_errorCodes));
	}