解析 IfIntXx:varname,123 中的冒号后面的部分（1个条件参数后面带1个Int值）
@param $paramstr string
@param $validatorName string 条件验证子'IfIntXx'
@return array|false 出错返回false, 否则返回 ['varname', 123]
@throws ValidationException
349134
private static function _parseIfXxxWith1Param1Int($paramstr, $validatorName)
    {
        $params = explode(',', $paramstr);
        if (count($params) != 2)
            return false;

        $varName = $params[0];
        $value = $params[1];
        self::validateInt($value, "“$validatorName:${paramstr}”中“${varName}”后面必须是整数，实际上却是“${value}”");
        return [$varName, intval($value)];
    }
1174442
protected function _validator_number($input, $value) {
		if (!is_string($value) && !is_integer($value) && !is_float($value)) return false;
		if (is_string($value)) $value = (int)$value;
		return is_integer($value);
	}
25774
protected function _validate_secint($value, $parameters)
    {
        $v = $this->secint->decode($value, isset($parameters[0]) ? $parameters[0] : '');
        if ($v === false) {
            return null;
        } else {
            return $v;
        }
    }
31001
public function validateObjectFieldValue($value, $fieldName, $targetObject, &$validatorParams, $validatorKey) {

        if (!$value) return true;

        if ($this->regexp) {
            $regexp = $this->regexp;
        } else {
            if (sizeof($validatorParams) < 1) {
                throw new MisconfiguredValidatorException($validatorKey, $fieldName, $targetObject);
            }

            $regexp = $validatorParams[0];

        }

        return preg_match("/^" . $regexp . "$/", $value) == 1;

    }
270320
protected function getValidatorData($validatorClassName)
    {
        if (false === isset($this->validatorsData[$validatorClassName])) {
            $this->validatorsData[$validatorClassName] = [];

            if (in_array(AbstractValidator::class, class_parents($validatorClassName))) {
                $validatorReflection = new \ReflectionClass($validatorClassName);
                $validatorProperties = $validatorReflection->getDefaultProperties();
                unset($validatorReflection);

                $validatorData = [
                    'supportedOptions'   => $validatorProperties['supportedOptions'],
                    'acceptsEmptyValues' => $validatorProperties['acceptsEmptyValues']
                ];

                if (in_array(FormzAbstractValidator::class, class_parents($validatorClassName))) {
                    $validatorData['formzValidator'] = true;
                    $validatorData['supportedMessages'] = $validatorProperties['supportedMessages'];
                    $validatorData['supportsAllMessages'] = $validatorProperties['supportsAllMessages'];
                }

                $this->validatorsData[$validatorClassName] = $validatorData;
            }
        }

        return $this->validatorsData[$validatorClassName];
    }
687301
public function validateInArray($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'in_array');

        $explicitPath = ValidationData::getLeadingExplicitAttributePath($parameters[0]);

        $attributeData = ValidationData::extractDataFromPath($explicitPath, $this->data);

        $otherValues = Arr::where(Arr::dot($attributeData), function ($value, $key) use ($parameters) {
            return Str::is($parameters[0], $key);
        });

        return in_array($value, $otherValues);
    }
443272
public function validate( $variableSet, $nsMgr )
	{
		if ( isset( $this->as ) && strlen( $this->as ) )
		{
			$asQname = qname( $this->as, $nsMgr->getNamespaces() );
			// if ( is_null( $asQname ) || \XBRL::startsWith( $this->as, "xs:" ) || $asQname->namespaceURI != \XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_SCHEMA ] )
			if ( $asQname && ! \XBRL::startsWith( $this->as, "xs:" ) && $asQname->namespaceURI == \XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_SCHEMA ] )
			{
				\XBRL_Log::getInstance()->formula_validation( 'Variable parameter', 'Parameter type has namespace reserved for functions in the function registry (xfi)', array(
					'parameter' => $this->getQName()->clarkNotation(),
					'as' => $this->as,
					'error' => 'xbrlve:parameterTypeMismatch'
				) );

				return false;
			}
		}

		if ( isset( $this->select ) && strlen( $this->select ) )
		{
			try
			{
				$expression = XPath2Expression::Compile( $this->getSelectAsExpression(), $nsMgr );
				$this->expression = $expression;
			}
			catch( XPath2Exception $ex )
			{
				throw $ex;
			}
		}

		return true;
	}
1114455
public function validate(...$params)
    {
        list($name, $value, $min, $max, $throws, $template) = $params;

        return ValidatorHelper::validateInteger($name, $value, $min, $max, $throws, $template);
    }
607967
public function validate($validator)
    {
        // Baily Early (if tags are used):
        
        if ($this->usesTags()) {
            return true;
        }
        
        // Call Parent Method (if not multiple):
        
        if (!$this->isMultiple()) {
            return parent::validate($validator);
        }
        
        // Obtain User Values:
        
        $values = $this->getValueArray();
        
        // Detect Invalid Values:
        
        $invalid = array_filter(
            $values,
            function ($userValue) {
                foreach ($this->getValidValues() as $formValue) {
                    if ($this->isSelectedValue($formValue, $userValue)) {
                        return false;
                    }
                }
                return true;
            }
        );
        
        // Answer Success (if none invalid):
        
        if (empty($invalid)) {
            return true;
        }
        
        // Define Validation Error:
        
        $validator->validationError(
            $this->getName(),
            _t(
                __CLASS__ . '.INVALIDOPTIONS',
                'Please select values within the list provided. Invalid option(s) {values} given.',
                [
                    'values' => implode(', ', $invalid)
                ]
            ),
            'validation'
        );
        
        // Answer Failure (invalid values detected):
        
        return false;
    }
198200
public function validate($validator)
    {
        if (!is_null($this->maxLength) && mb_strlen($this->value) > $this->maxLength) {
            $validator->validationError(
                $this->name,
                _t(
                    'SilverStripe\\Forms\\TextField.VALIDATEMAXLENGTH',
                    'The value for {name} must not exceed {maxLength} characters in length',
                    array('name' => $this->getName(), 'maxLength' => $this->maxLength)
                ),
                "validation"
            );
            return false;
        }
        return true;
    }
704136
public function validateDistinct($attribute, $value, $parameters)
    {
        $data = Arr::except($this->getDistinctValues($attribute), $attribute);

        if (in_array('ignore_case', $parameters)) {
            return empty(preg_grep('/^'.preg_quote($value, '/').'$/iu', $data));
        }

        return ! in_array($value, array_values($data));
    }
848544
private static function _parseIfXxxWith1ParamMultiInts($paramstr, $validatorName)
    {
        $params = explode(',', $paramstr);
        $c = count($params);
        if ($c < 2)
            return false;

        $varName = $params[0];
        $vals = [];
        for ($i = 1; $i < $c; $i++) {
            $intVal = $params[$i];
            self::validateInt($intVal, "“$validatorName:${paramstr}”中“${varName}”后面必须全部是整数，实际上却包含了“${intVal}”");
            $vals[] = intval($intVal);
        }
        return [$varName, $vals];
    }
144836
protected function validateDigits($attribute, $value, $parameters)
    {
        $this->requireParameterCount(1, $parameters, 'digits');

        return $this->validateNumeric($attribute, $value)
            && strlen((string) $value) == $parameters[0];
    }
366716
public static function isValid($validator, $value)
    {
        /** @var ValidatorInterface $validator */
        $validator = static::create($validator);
        $result = $validator->isValid($value);
        static::$_messages = $validator->getMessages();
        return $result;
    }
739694
public function validate( $variableSet, $nsMgr )
	{
		$log = \XBRL_Log::getInstance();

		try
		{
			if ( isset( $this->value ) && ! empty( $this->value ) )
			{
				$expression = XPath2Expression::Compile( $this->value, $nsMgr );
				$this->valueXPath2expression = $expression;

				if ( ! $this->source && ! $this->unitRule )
				{
					$qnames = $expression->getParameterQNames();
					$vars = array();
					foreach( $qnames as $qname )
					{
						$vars[ $qname->clarkNotation() ] = 1;
					}
					$resultType = $expression->GetResultType( $vars );

					// If the result is number then there MUST be a unit rule
					if ( $resultType == XPath2ResultType::Number )
					{
						$log->formula_validation( "Formula", "A formula with a numeric result MUST have a unit rule",
							array(
								'error' => 'xbrlfe:missingUnitRule'
							)
						);
					}
				}
			}
		}
		catch ( XPath2Exception $ex )
		{
			// BMS 2018-03-27 Test 21201 V-01 requires that this compile failure return xbrlve:noCustomFunctionSignature
			//				  because the custom function my-own:ending-balance does not exist
			$log->formula_validation( "Formula", "Failed to compile value expression",
				array(
					'formula' => $this->label,
					'value' => $this->value,
					'error' => $ex->ErrorCode == 'XPST0017' ? "xbrlve:noCustomFunctionSignature" : $ex->ErrorCode,
					'reason' => $ex->getMessage()
				)
			);

			return false;

		}
		catch ( FormulasException $ex )
		{
			throw $ex;
		}
		catch ( \Exception $ex )
		{
			// BMS 2018-03-27 Test 21201 V-01 requires that this compile failure return xbrlve:noCustomFunctionSignature
			//				  becauase the custom function my-own:ending-balance does not exist
			$log->formula_validation( "Formula", "Failed to compile value expression",
				array(
					'formula' => $this->label,
					'value' => $this->value,
					'error' => $ex instanceof XPath2Exception ? ( $ex->ErrorCode == 'XPST0017' ? "err:XPST0017" : $ex->ErrorCode ) : get_class( $ex ),
					'reason' => $ex->getMessage()
				)
			);

			return false;
		}

		if ( $this->tupleLocationRule )
		{
			// The name given in the rule MUST be one of the scope dependency indexes
			if ( ! isset( $this->scopeDependencies[ $this->tupleLocationRule ] ) )
			{
				// Not valid so remove the rule
				$log->warning( "The tuple loctation rule ({$this->tupleLocationRule}) on formula '{$this->label}' does not match the name on a variable scope arc so will be ignored." );
				$this->tupleLocationRule = null;
			}

		}

		if ( $this->decimalsRule && ! is_numeric( $this->precisionRule ) )
		{
			try
			{
				$xpath2Expression = XPath2Expression::Compile( $this->decimalsRule, $nsMgr );
			}
			catch ( XPath2Exception $ex )
			{
				\XBRL_Log::getInstance()->formula_validation( "Formula decimal value", "Failed to compile expression",
					array(
						'qname expression' => $this->decimalsRule,
						'error' => $ex instanceof XPath2Exception ? ( $ex->ErrorCode == 'XPST0017' ? "xbrlve:noCustomFunctionSignature" : $ex->ErrorCode ) : get_class( $ex ),
						'reason' => $ex->getMessage()
					)
				);
			}
			catch ( \Exception $ex )
			{
				// BMS 2018-03-27 Test 21201 V-02 requires that this compile failure return xbrlve:noCustomFunctionSignature
				//				  becauase the custom function my-own:ending-balance does not exist
				\XBRL_Log::getInstance()->formula_validation( "Formula decimal value", "Failed to compile expression",
					array(
						'qname expression' => $this->decimalsRule,
						'error' => $ex instanceof XPath2Exception ? ( $ex->ErrorCode == 'XPST0017' ? "err:XPST0017" : $ex->ErrorCode ) : get_class( $ex ),
						'reason' => $ex->getMessage()
					)
				);
			}
		}

		if ( $this->precisionRule && ! is_numeric( $this->precisionRule ) )
		{
			try
			{
				$xpath2Expression = XPath2Expression::Compile( $this->precisionRule, $nsMgr );
			}
			catch ( XPath2Exception $ex )
			{
				\XBRL_Log::getInstance()->formula_validation( "Formula precision value", "Failed to compile expression",
					array(
						'qname expression' => $this->precisionRule,
						'error' => $ex instanceof XPath2Exception ? ( $ex->ErrorCode == 'XPST0017' ? "xbrlve:noCustomFunctionSignature" : $ex->ErrorCode ) : get_class( $ex ),
						'reason' => $ex->getMessage()
					)
				);
			}
			catch ( \Exception $ex )
			{
				// BMS 2018-03-27 Test 21201 V-01 requires that this compile failure return xbrlve:noCustomFunctionSignature
				//				  becauase the custom function my-own:ending-balance does not exist
				\XBRL_Log::getInstance()->formula_validation( "Formula precision value", "Failed to compile expression",
					array(
						'qname expression' => $this->precisionRule,
						'error' => $ex instanceof XPath2Exception ? ( $ex->ErrorCode == 'XPST0017' ? "err:XPST0017" : $ex->ErrorCode ) : get_class( $ex ),
						'reason' => $ex->getMessage()
					)
				);
			}
		}

		// If there is no source then concept MUST be explicitly declared
		if ( is_null( $this->source ) )
		{
			if ( is_null( $this->conceptRule ) )
			{
				$log->formula_validation( "Formula", "If there is no source then a concept aspect rule MUST be explicitly declared but is not provided",
					array(
						'formula' => $this->label,
						'error' => 'xbrlfe:missingConceptRule'
					)
				);
			}

			if ( is_null( $this->entityIdentifierRule ) )
			{
				$log->formula_validation( "Formula", "If there is no source then an entity aspect rule MUST be explicitly declared but is not provided",
					array(
						'formula' => $this->label,
						'error' => 'xbrlfe:missingEntityIdentifierRule'
					)
				);
			}

			if ( is_null( $this->periodRule ) )
			{
				$log->formula_validation( "Formula", "If there is no source then an period aspect rule MUST be explicitly declared but is not provided",
					array(
						'formula' => $this->label,
						'error' => 'xbrlfe:missingPeriodRule'
					)
				);
			}

			// Create a qname from either the qname or the expression
			/**
			 * @var QName $qname
			 */
			$qname = null;
			if ( $this->conceptRule['qnameExpression'] )
			{
				foreach ( $this->conceptRule['qnameExpression'] as $qnameExpression )
				{
					// Check any variables in the expression are valid
					$expression = XPath2Expression::Compile( $qnameExpression, $this->nsMgr );
					$variableRefs = $expression->getParameterQNames();
					foreach ( $variableRefs as $variableQName )
					{
						if ( ! isset( $this->variablesByQName[ $variableQName->clarkNotation() ] ) )
						{
							$log->formula_validation( "Concept rule", "The variable reference in the concept rule qname expression is not to a valid variable",
								array(
									'formula' => $this->label,
									'variable reference' => $variableQName->clarkNotation(),
									'error' => 'xbrlfe:conceptExpressionInvalid'
								)
							);
						}
					}
				}
			}
			else
			{
				$qname = new QName( $this->conceptRule['qname'][0]['originalPrefix'], $this->conceptRule['qname'][0]['namespace'], $this->conceptRule['qname'][0]['name'] );

				// BMS 2018-03-19 Must have been having too many mince pies.  These tests are relevant whenever there is a known concept.
				// 				  They have been moved lower down
				// BMS 2018-01-05 Now not sure why these tests are needed.
	 			// Next find out if the qname refers to a variable.  If it does look for a filter that defines a concept
	 			// Begin by assuming the qname refers to a taxonomy element
	 			$concept = $qname;
	 			if ( isset( $this->variablesByQName[ $concept->clarkNotation() ] ) )
	 			{
	 				/**
	 				 * @var ConceptName $selectedFilter
	 				 */
	 				$selectedFilter = null;
	 				foreach ( $this->variablesByQName[ $concept->clarkNotation() ]->filters as $filter )
	 				{
	 					if ( ! $filter instanceof ConceptName ) continue;
	 					$selectedFilter = $filter;
	 					break;
	 				}

	 				if ( $selectedFilter )
	 				{
						$concept = null;
						$totalFilters = count( $selectedFilter->qnames ) + count( $selectedFilter->qnameExpressions );
						if ( $totalFilters == 1 )
						{
							// It's one of these
							foreach ( $selectedFilter->qnames as $filterQName )
							{
								$concept = qname( $filterQName );
								$taxonomy = $this->xbrlTaxonomy->getTaxonomyForNamespace( $concept->namespaceURI );
								$concept->prefix = $taxonomy->getPrefix();
							}

							if ( ! $concept )
							{
								foreach ( $selectedFilter->qnameExpressions as $filterQNameExpression )
				 				{
									$result = $this->evaluateXPath( $this, $this->conceptRule->$filterQNameExpression );
									$concept = new QName( $result->Prefix, $result->NamespaceUri, $result->LocalName );
			 					}
							}
						}

						if ( $totalFilters != 1 || ! $concept )
						{
							$log->formula_validation( "Formula", "There is no formula source but the concept aspect rule does not define a reference to a schema element",
								array(
									'formula' => $this->label,
									'error' => 'xbrlfe:missingConceptRule'
								)
							);
						}
	 				}
	 				else
	 				{
	 					// If the concept references a variable and there is no filter then the
	 					// the concept cannot be resolved statically.
	 					$concept = null;
	 				}
				}

				if ( $concept )
				{
					// BMS 2017-12-24 Move the following tests here because surely they are only relevant when there is no formula source
					/**
					 * @var SchemaTypes $types
					 */
					$types = \XBRL_Types::getInstance();
					$conceptElement = $this->xbrlTaxonomy->getElementByName( $concept->localName );
					// Or could do it this way
					// $conceptElement = $types->getElement( $this->conceptRule['qname'][0]['name'], $this->conceptRule['qname'][0]['originalPrefix'] );
					// $isNumeric = $types->resolvesToBaseType( $conceptElement['types'][0], array( 'xs:decimal', 'xs:decimal' ) );
					if ( ! $conceptElement )
					{
						$log->formula_validation( "Formula", "The concept provided by the concept aspect rule is not a valid schema element",
							array(
								'formula' => $label,
								'error' => 'xbrlfe:missingConceptRule'
							)
						);
					}

					// BMS 2018-04-09 Extra test candidate not required any more but it doesn't hurt.
					$isNumeric = $types->resolvesToBaseType( $conceptElement['type'], array( 'xs:decimal', 'xsd:decimal' ) );
					if ( is_null( $this->source ) && is_null( $this->unitRule ) )
					{
						// Check to see if the concept references a numeric type
						if ( $isNumeric )
						{
							$log->formula_validation( "Formula", "If there is no source and the concept references a numeric type then a unit aspect rule MUST be explicitly declared but is not provided",
								array(
									'formula' => $this->label,
									'error' => 'xbrlfe:missingUnitRule'
								)
							);
						}
					}
					else if ( ! is_null( $this->unitRule ) )
					{
						if ( ! $isNumeric )
						{
							$log->formula_validation( "Formula", "The concept aspect rule defines a non-numeric concept so a unit is not valid",
								array(
									'formula' => $this->label,
									'error' => 'xbrlfe:conflictingAspectRules'
								)
							);
						}
					}

					// BMS 2018-03-19 Don't know why this is here when it is defined below
					// // Make sure there is no conflict between the concept and period aspect rule
					// if ( ! is_null( $this->periodRule ) )
					// {
					// 	if ( ! is_null( $this->periodRule['rav'] ) && $this->periodRule['rav'] != $conceptElement['periodType'] )
					// 	{
					// 		$log->formula_validation( "Formula", "The type of the period aspect rule conflicts with the period type of the concept aspect rule",
					// 			array(
					// 				'period aspect type' => $this->periodRule['rav'],
					// 				'concept period type' => $conceptElement['periodType'],
					// 				'formula' => $this->label,
					// 				'error' => 'xbrlfe:conflictingAspectRules'
					// 			)
					// 		);
					// 	}
					// }
				}
			}
		}
		else // $source is not null
		{
			$sourceQName = new QName( $this->source['originalPrefix'], $this->source['namespace'], $this->source['name'] );

			// If the if the source is not the uncovered qname make sure the referenced variable exists
			// if ( $sourceQName->namespaceURI != \XBRL_Constants::$standardPrefixes[ STANDARD_PREFIX_FORMULA ] ||
			//	 $sourceQName->localName != "uncovered" )
			if ( ! $this->getIsFormulaUncoveredQName( $sourceQName ) )
			{
				if ( ! isset( $this->variablesByQName[ $sourceQName->clarkNotation() ] ) ||
					 ! $this->variablesByQName[ $sourceQName->clarkNotation() ] instanceof FactVariable
				)
				{
					$log->formula_validation( "Formula", "",
						array(
							'concept' => $sourceQName->prefix ? "{$sourceQName->prefix}:{$sourceQName->localName}" : $sourceQName->localName,
							'formula' => $this->label,
							'error' => 'xbrlfe:nonexistentSourceVariable',
						)
					);
				}

				/**
				 * Look for the variable
				 * @var FactVariable $variable
				 */
				$variable = $this->variablesByQName[ $sourceQName->clarkNotation() ];
				if ( $variable->bindAsSequence )
				{
					// TODO Should check the XPath implied by the fallback value but, for now,
					//	    copy Arelle and fail if there is any fallback value
					$log->formula_validation( "Formula", "Formula source is a fact variable that binds as a sequence",
						array(
							'formula' => $this->label,
							'source' => $sourceQName->prefix ? "{$sourceQName->prefix}:{$sourceQName->localName}" : $sourceQName->localName,
							'error' => 'xbrlfe:defaultAspectValueConflicts',
						)
					);
				}
			}

			if ( $this->conceptRule['qname'] )
			{
				// BMS 2015-03-26
				// If the concept rule is really a source then the qname will reference a variable so reset
				$concept = new QName( $this->conceptRule['qname'][0]['originalPrefix'], $this->conceptRule['qname'][0]['namespace'], $this->conceptRule['qname'][0]['name'] );
				if ( isset( $this->variablesByQName[ $concept->clarkNotation() ] ) )
				{
					$concept = null;
				}
			}
		}

		if ( isset( $concept ) )
		{
			// BMS 2018-03-19 Must have been having too many mince pies.  These tests are relevant whenever there is a known concept.
			// 				  So they belong here.
			// BMS 2017-12-24 Move the following tests here because surely they are only relevant when there is no formula source
			$types = \XBRL_Types::getInstance();
			$conceptElement = $this->xbrlTaxonomy->getElementByName( $concept->localName );
			// Or could do it this way
			// $conceptElement = $types->getElement( $this->conceptRule['qname'][0]['name'], $this->conceptRule['qname'][0]['originalPrefix'] );
			// $isNumeric = $types->resolvesToBaseType( $conceptElement['types'][0], array( 'xs:decimal', 'xsd:decimal' ) );
			if ( ! $conceptElement )
			{
				$log->formula_validation( "Formula", "The concept provided by the concept aspect rule is not a valid schema element",
					array(
						'formula' => $label,
						'error' => 'xbrlfe:missingConceptRule'
					)
				);
			}

			// BMS 2018-04-09 Extra test candidate not required any more but it doesn't hurt.
			$isNumeric = $types->resolvesToBaseType( $conceptElement['type'], array( 'xs:decimal', 'xsd:decimal' ) );
			if ( is_null( $this->source ) && is_null( $this->unitRule ) )
			{
				// Check to see if the concept references a numeric type
				if ( $isNumeric )
				{
					$log->formula_validation( "Formula", "If there is no source and the concept references a numeric type then a unit aspect rule MUST be explicitly declared but is not provided",
						array(
							'formula' => $this->label,
							'error' => 'xbrlfe:missingUnitRule'
						)
					);
				}
			}
			else if ( ! is_null( $this->unitRule ) )
			{
				if ( ! $isNumeric )
				{
					$log->formula_validation( "Formula", "The concept aspect rule defines a non-numeric concept so a unit is not valid",
						array(
							'formula' => $this->label,
							'error' => 'xbrlfe:conflictingAspectRules'
						)
					);
				}
			}

			// Make sure there is no conflict between the concept and period aspect rule
			if ( ! is_null( $this->periodRule ) )
			{
				if ( ! is_null( $this->periodRule['rav'] ) && $this->periodRule['rav'] != $conceptElement['periodType'] )
				{
					$log->formula_validation( "Formula", "The type of the period aspect rule conflicts with the period type of the concept aspect rule",
						array(
							'period aspect type' => $this->periodRule['rav'],
							'concept period type' => $conceptElement['periodType'],
							'formula' => $this->label,
							'error' => 'xbrlfe:conflictingAspectRules'
						)
					);
				}
			}

		}

		$sources = $this->getAspectSources();
		foreach ( $sources as $ruleName => $source )
		{
			if ( $this->getIsFormulaUncoveredQName( $source ) ) continue;

			$sourceQName = new QName( $source['originalPrefix'], $source['namespace'], $source['name'] );
			/**
			 * Look for the variable
			 * @var FactVariable $variable
			 */
			$variable = $this->variablesByQName[ $sourceQName->clarkNotation() ];
			if ( ! $variable->fallbackValue ) continue;

			// TODO Should check the XPath implied by the fallback value but, for now,
			//	    copy Arelle and fail if there is any fallback value
			$log->formula_validation( "Formula aspects", "Formula source is a fact variable that has a fallback value",
				array(
					'formula' => $this->label,
					'rule' => $ruleName,
					'error' => 'xbrlfe:bindEmptySourceVariable',
				)
			);
		}

		return true;
	}
1089826
public function getValidationMessages($validator = null)
    {
        if ($validator) {
            return isset($this->validationMessages[$validator]) ? $this->validationMessages[$validator] : null;
        }

        return $this->validationMessages;
    }
797375
public function validateUrl($attribute, $params)
    {
        $parentParentId = (null === $this->structure) ? 0 : (int)$this->structure->parent_id;
        $parentContextId = (null === $this->structure) ? 0 : (int)$this->structure->context_id;
        if (
            $this->slug != $this->oldSlug
            || $this->parentParentId !== $parentParentId
            || $this->parentContextId !== $parentContextId
        ) {
            $url = $this->compileUrl();
            $query = self::find()
                ->select('url')
                ->innerJoin(
                    BaseStructure::tableName(),
                    'model_id = ' . BaseStructure::tableName() . '.id'
                )
                ->where([
                    'language_id' => $this->language_id,
                    'context_id' => $this->parentContextId,
                    'url' => $url
                ]);
            if (false === $this->isNewRecord) {
                $query->andWhere(['not', ['model_id' => $this->model_id]]);
            }
            $isset = $query->scalar();
            if (false !== $isset) {
                $this->addError('slug', Yii::t(
                    'dotplant.entity.structure',
                    'Value \'{value}\' already in use, please, choose another!',
                    ['value' => $this->slug]
                ));
            }
            $this->url = $url;
        }
    }