Verifica se o valor passado corresponde ao tipo/formato.
esperado.

@param       ?string $v
Valor a ser testado.

@param       ?array $aux
Dados auxiliares para o processamento.

@return      bool
557595
public static function check(?string $v, ?array $aux = null) : bool
    {
        if ($v !== null) {
            if (StringExtension::isPatternMatch($v, self::RegExp) === true && Date::weekMember($v) !== null) {
                return true;
            }
        }

        return false;
    }
465787
function exportValue(&$submitValues, $assoc = false)
    {
        $value = $this->_findValue($submitValues);
        if (null === $value) {
            $value = $this->getValue();
        } elseif (is_array($this->_values) && ($value != $this->_values[0]) && ($value != $this->_values[1])) {
            $value = null;
        }
        return $this->_prepareValue($value, $assoc);
    }
714274
function isVATKnown()
    {
        $result = true;
        foreach ( $this->items() as $item )
        {
            if ( $item['vat_value'] == -1 )
                return false;
        }

        return true;
    }
542609
public function Equals($obj)
	{
		if ( ! $obj instanceof LanguageValue )
		{
			return false;
		}

		/**
		 * @var TokenValue $other
		 */
		$other = $obj;
		return strcmp( $this->Value, $other->Value ) == 0;
	}
1014150
protected function formatar($nome, $valor)
    {
        $ref = new \ReflectionProperty(get_class($this), $nome);
        $factory = DocBlockFactory::createInstance();
        $info = $factory->create($ref->getDocComment());

        // Pegar o tipo da variavel
        $tipo = $info->getTagsByName('var');
        $tipo = (count($tipo) == 0) ? 'string' : $tipo[0]->getType();
        $tipo = strtolower($tipo);

        switch ($tipo) {

            case 'string':
            case 'string|null':
            case '\string':
            case '\string|null':
                $valor = str_replace(['@'], ['#1#'], utf8_encode($valor)); // Ignorar alguns caracteres no ascii
                $valor = Str::ascii($valor);
                $valor = str_replace(['&'], ['e'], $valor);
                $valor = str_replace(['#1#'], ['@'], $valor); // Retornar caracteres ignorados
                $valor = Str::upper($valor);
                $valor = trim($valor);

                // Max
                $max = $info->getTagsByName('max');
                if (count($max) > 0) {
                    $max = intval($max[0]->getDescription()->render());
                    $valor = trim(substr($valor, 0, $max));
                }

                return $valor;

            case 'float|null':
            case 'float':
                $dec = $info->getTagsByName('dec');
                if (count($dec) == 0) {
                    return $valor;
                }

                // Valor do @dec
                $dec = $dec[0]->getDescription()->render();

                return number_format($valor, $dec, '.', '');

            case 'datetime':
            case '\datetime':
            case '\datetime|null':
            case 'date':
            case 'date|null':
            case '\date':
            case '\date|null':
                if (is_int($valor)) {
                    $valor = Carbon::createFromTimestamp($valor);
                }

                if (is_string($valor)) {
                    return $valor;
                }

                $format = in_array($tipo, ['date', 'date|null', '\date', '\date|null']) ? 'Y-m-d' : Carbon::ATOM;

                return $valor->format($format);

            default:
                return $valor;
        }
    }
983160
public static function isEmpty($value, $format, $args = null, $_ = null) {
        if (!empty($value)) {
            self::vfail($format, array_slice(func_get_args(), 2));
        }
        return $value;
    }
943142
public function check($value, IValidationData $data = null) {
        if (is_string($value)) {
            return strlen($value) <= $this->max;
        } else if (is_array($value)) {
            return count($value) <= $this->max;
        }

        return false;
    }
1152743
protected static function _isSubject($v) {
    // Note: A value is a subject if all of these hold true:
    // 1. It is an Object.
    // 2. It is not a @value, @set, or @list.
    // 3. It has more than 1 key OR any existing key is not @id.
    $rval = false;
    if(is_object($v) &&
      !property_exists($v, '@value') &&
      !property_exists($v, '@set') &&
      !property_exists($v, '@list')) {
      $count = count(get_object_vars($v));
      $rval = ($count > 1 || !property_exists($v, '@id'));
    }
    return $rval;
  }
365228
public static function check(?string $v, ?array $aux = null) : bool
    {
        if ($v !== null && StringExtension::isPatternMatch($v, self::RegExp) === true) {
            $cnpj = StringExtension::onlyCharCollection($v, "0123456789");

            if (mb_strlen($cnpj) === 14 && is_numeric($cnpj) === true) {
                // Se não for nenhum dos padrões inválidos de CNPJ...
                if ($cnpj !== "00000000000000" && $cnpj !== "11111111111111" && $cnpj !== "22222222222222" &&
                    $cnpj !== "33333333333333" && $cnpj !== "44444444444444" && $cnpj !== "55555555555555" &&
                    $cnpj !== "66666666666666" && $cnpj !== "77777777777777" && $cnpj !== "88888888888888" &&
                    $cnpj !== "99999999999999") {
                    $a = [];
                    $b = 0;
                    $c = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
                    for ($i = 0; $i < 12; $i++) {
                        $a[$i] = $cnpj[$i];
                        $b += $a[$i] * $c[$i + 1];
                    }

                    $x = $b % 11;
                    $a[12] = ($x < 2) ? 0 : 11 - $x;


                    $b = 0;
                    for ($y = 0; $y < 13; $y++) {
                        $b += ($a[$y] * $c[$y]);
                    }
                    $x = $b % 11;
                    $a[13] = ($x < 2) ? 0 : 11 - $x;

                    if (((int)$cnpj[12] === (int)$a[12]) && ((int)$cnpj[13] === (int)$a[13])) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
160308
function is_valid_value($value) {
        if(is_array($value)) {
            if(!$this->val_multi) {
                return false;
            }
            else {
                foreach($value as $oneval) {
                    if(!rfc2445_is_valid_value($oneval, $this->val_type)) {
                        return false;
                    }
                }
            }
            return true;
        }
        return rfc2445_is_valid_value($value, $this->val_type);
    }
22581
public static function isTrue($value, $format, $args = null, $_ = null) {
        if (!$value) {
            self::vfail($format, array_slice(func_get_args(), 2));
        }
        return $value;
    }
631801
protected function checkValue(&$errors = [])
    {
        if ($this->getRequired() && !array_key_exists($this->getName(), $_FILES)) {
            $errors[] = $this->getLabel() . ' is required.';
            $this->error = $this->getLabel() . ' is required.';
            return false;
        }

        return true;
    }
203054
public function setValue($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->value !== $v) {
            $this->value = $v;
            $this->modifiedColumns[FeatureTypeAvMetaTableMap::VALUE] = true;
        }


        return $this;
    }
561953
public function val($val = null) {
		$val = (int) $val;
		if ($val) {
			if (is_numeric($val) && is_int($val*1)) {
				if (in_array($this->sources[$val],$this->sources)) {
					$this->val = $val;
					return $this->val;
				}
			} else {
				throw new \SimplOn\DataValidationException($this->valudationNaN);
			}
		} else {
			return $this->val;
		}
	}
1290228
public function ingresarAceptacionReclamoDoc($rut, $dv, $dte, $folio, $accion)
    {
        // ingresar acción al DTE
        $r = $this->request('ingresarAceptacionReclamoDoc', [
            'rutEmisor' => $rut,
            'dvEmisor' => $dv,
            'tipoDoc' => $dte,
            'folio' => $folio,
            'accionDoc' => $accion,
        ]);
        // si no se pudo recuperar error
        if ($r===false) {
            return false;
        }
        // entregar resultado del ingreso
        return [
            'codigo' => $r->codResp,
            'glosa' => $r->descResp,
        ];
    }
1192686
public function isSameAs($format, Verta $v = null)
    {
        $v = $v ?: static::now($this->timezone);

        return $this->format($format) === $v->format($format);
    }
741790
static private function _checkData($arr, $v) 
    {
        foreach($arr as $key=>$value)
        {
            if(!is_array($key)) { 
                if ($res = static::_checkString($key, $v)) {
                    return $res;
                }
            } else { 
                if ($res = static::_checkData($key, $v)) {
                    return $res;
                }
            }
            
            if(!is_array($value)) { 
                if ($res = static::_checkString($value, $v)) {
                    return $res;
                }
            } else { 
                if ($res = static::_checkData($value, $v)) {
                    return $res;
                }
            }
        }
        
        return null;
    }