Short description of method getCompositionRules

@access public
@author Joel Bout, <joel.bout@tudor.lu>
@return array
327885
public function getCompositionRules()
    {
        $subExpressions = array();
        foreach ($this->components as $irp) {
        	$subExpressions[] = new CommonExpression('variable', array('identifier' => $irp->getOutcome()->getIdentifier()));
        }
        $sum = new CommonExpression('sum', array());
        $sum->setSubExpressions($subExpressions);
        $summationRule = new SetOutcomeVariable($this->outcomeIdentifier, $sum);
        
        $returnValue = array($summationRule);

        return (array) $returnValue;
    }
225683
public function getEntityRules()
    {
        $cache = $this->getCache();
        if ($cache) {
            $this->entityLocalRules = $cache->get($this->getEntityRulesCacheKey());
        }
        if (empty($this->entityLocalRules) || !is_array($this->entityLocalRules)) {
            $rules = array_merge($this->getGuidRules(), $this->getIdRules(), $this->getCreatedAtRules(), $this->getUpdatedAtRules(), $this->getExpiredAfterRules(), $this->getIpRules());
            $this->setEntityRules($rules);
        }
        return $this->entityLocalRules;
    }
861202
public function getIdRules()
    {
        if ($this->idAttribute == false) {
            return [];
        }
        if ($this->idAttributeSafe || $this->idAttributeType === static::$idTypeAutoIncrement) {
            return [
                [[$this->idAttribute], 'safe'],
            ];
        }
        if (is_string($this->idAttribute) && !empty($this->idAttribute) &&
            is_int($this->idAttributeLength) &&
            $this->idAttributeLength > 0) {
            $rules = [
                [[$this->idAttribute], 'required'],
                [[$this->idAttribute], 'unique'],
            ];
            if ($this->idAttributeType === static::$idTypeInteger) {
                $rules[] = [
                    [$this->idAttribute], 'number', 'integerOnly' => true
                ];
            }
            if ($this->idAttributeType === static::$idTypeString) {
                $rules[] = [[$this->idAttribute], 'string',
                    'max' => $this->idAttributeLength,];
            }
            return $rules;
        }
        return [];
    }
1266153
public function getRules()
    {
        if (!isset($this->ruleSet)) {
            $this->ruleSet = new PriorityList(RuleInterface::class);
        }
        return $this->ruleSet;
    }
688294
protected function getRules()
    {
        $result = [];
        $relationNames = [];
        foreach ($this->relations as $key => $value) {
            $relationNames[] = is_array($value) ? $key : $value;
        }

        foreach ($this->owner->rules() as $key => $rule) {
            $attributes = is_array($rule[0]) ? $rule[0] : [$rule[0]];
            if (!$relations = array_intersect($relationNames, $attributes)) {
                continue;
            }
            $rule[0] = $relations;
            $result[$key] = $rule;
        }
        return $result;
    }
1085082
public function getClauses()
    {
        return array(
            $this->getUpdate(),
            $this->getJoins(),
            $this->getSet(),
            $this->getWhere(),
            $this->getOrder(),
            $this->getLimit(),
        );
    }
302947
protected function getRules()
    {
        if ($this->rules instanceof \Closure) {
            return $this->rules->call($this, $this->form);
        }

        return $this->rules;
    }
709976
public function rules()
    {
        $rules = $this->filterRules(array_merge([
            [['username', 'password'], 'trim'],
            [['username', 'password'], 'required'],
            ['rememberMe', 'boolean'],
            ['password', 'authenticate'],
        ], $this->rulesAddScenario(parent::rules(), 'reset')));

        return $rules;
    }
1058030
public function getValidationRules()
    {
        $rules = $this->getOption('rules', []);
        $name = $this->getNameKey();
        $messages = $this->getOption('error_messages', []);
        $formName = $this->formHelper->transformToDotSyntax($this->parent->getName());

        if ($messages && $formName) {
            $newMessages = [];
            foreach ($messages as $messageKey => $message) {
                $messageKey = sprintf('%s.%s', $formName, $messageKey);
                $newMessages[$messageKey] = $message;
            }
            $messages = $newMessages;
        }

        if (!$rules) {
            return (new Rules([]))->setFieldName($this->getNameKey());
        }

        if (is_array($rules)) {
            $rules = array_map(function ($rule) use ($name) {
                if ($rule instanceof \Closure) {
                    return $rule($name);
                }

                return $rule;
            }, $rules);
        }

        return (new Rules(
            [$name => $rules],
            [$name => $this->getOption('label')],
            $messages
        ))->setFieldName($this->getNameKey());
    }
1362507
public function getRules()
    {
        $perm = $this->permissions;
        $data = array();

        foreach ($perm as $val)
        {
            list($prefix,$data[]) = explode('.', $val);
        }

        return implode(',',$data);
    }
500435
public function getAliases() {
        $result = [];

        foreach ($this->rules as $name => $rule) {
            if (!empty($rule['aliasOf']) && $rule['aliasOf'] === $this->currentRuleName) {
                $result[] = $name;
            }
        }

        return $result;
    }
1308195
protected function getTermRules()
    {
        $rules = [];

        foreach ($this->repository as $field) {
            $rules[$field->getName()] = $field->getOption('rules');
        }

        return $rules;
    }
1304725
public static function getSymfonyRules20()
    {
        return [
            'blank_line_after_opening_tag'                => true,
            'blank_line_before_return'                    => true,
            'cast_spaces'                                 => true,
            'concat_without_spaces'                       => false,
            'function_typehint_space'                     => true,
            'hash_to_slash_comment'                       => true,
            'heredoc_to_nowdoc'                           => false,
            'include'                                     => true,
            'lowercase_cast'                              => true,
            'method_separation'                           => true,
            'native_function_casing'                      => true,
            'new_with_braces'                             => true,
            'no_alias_functions'                          => true,
            'no_blank_lines_after_class_opening'          => true,
            'no_blank_lines_after_phpdoc'                 => true,
            'no_empty_statement'                          => true,
            'no_extra_consecutive_blank_lines'            => true,
            'no_leading_import_slash'                     => true,
            'no_leading_namespace_whitespace'             => true,
            'no_multiline_whitespace_around_double_arrow' => true,
            'no_short_bool_cast'                          => true,
            'no_singleline_whitespace_before_semicolons'  => true,
            'no_spaces_inside_offset'                     => true,
            'no_trailing_comma_in_list_call'              => true,
            'no_trailing_comma_in_singleline_array'       => true,
            'no_unneeded_control_parentheses'             => true,
            'no_unreachable_default_argument_value'       => true,
            'no_unused_imports'                           => true,
            'no_whitespace_before_comma_in_array'         => true,
            'no_whitespace_in_blank_lines'                => true,
            'object_operator_without_whitespace'          => true,
            'phpdoc_align'                                => true,
            'phpdoc_indent'                               => true,
            'phpdoc_inline_tag'                           => true,
            'phpdoc_no_access'                            => true,
            'phpdoc_no_empty_return'                      => true,
            'phpdoc_no_package'                           => true,
            'phpdoc_scalar'                               => true,
            'phpdoc_separation'                           => true,
            'phpdoc_single_line_var_spacing'              => true,
            'phpdoc_summary'                              => true,
            'phpdoc_to_comment'                           => true,
            'phpdoc_trim'                                 => true,
            'phpdoc_type_to_var'                          => true,
            'phpdoc_types'                                => true,
            'phpdoc_var_without_name'                     => true,
            'pre_increment'                               => true,
            'print_to_echo'                               => false,
            'self_accessor'                               => false,
            'short_scalar_cast'                           => true,
            'simplified_null_return'                      => true,
            'single_blank_line_before_namespace'          => true,
            'single_quote'                                => true,
            'space_after_semicolon'                       => true,
            'standardize_not_equals'                      => true,
            'ternary_operator_spaces'                     => true,
            'trailing_comma_in_multiline_array'           => true,
            'trim_array_spaces'                           => true,
            'unalign_double_arrow'                        => true,
            'unalign_equals'                              => true,
            'unary_operator_spaces'                       => true,
            'whitespace_after_comma_in_array'             => true,
        ];
    }
52167
public function rules(): array
    {
        $user = $this->route('role') ?? new Role();
        $user->updateRulesUniques();
        $rules = $user->getRules();
        $rules['abilities'] = 'nullable|array';

        return $rules;
    }
558277
public function getModelValidationRules()
    {
        $optionsRules = $this->getOption('rules');

        //if the 'rules' option was provided for this model, it takes precedent
        if (is_array($optionsRules)) {
            return $optionsRules;
        }

        //otherwise look for the rules as a static property on the model
        return $rules = $this->getModelStaticValidationRules() ?: array();
    }
1222545
public function validationRules():array
    {
        $rules = [];

        foreach ($this as $control) {
            $rule = $control->getRule();
            if (!empty($rule)) {
                $rules[$control->getName()] = $control->getRule();
            }
        }

        return $rules;
    }
734789
public function getSourceRules()
    {
        if (!is_string($this->sourceAttribute) || empty($this->sourceAttribute)) {
            return [];
        }
        if (empty($this->_sourceRules)) {
            $this->_sourceRules = [
                [[$this->sourceAttribute], 'required'],
                [[$this->sourceAttribute], 'string'],
            ];
        }
        return $this->_sourceRules;
    }