Rules maintain state so they should always new instances.

@return array
485206
public static function build(): array
    {
        $rules = [];

        foreach (self::$supportedRules as $className) {
            $rules[] = GraphQL::make($className);
        }

        return $rules;
    }
355859
public function getOtherGuidRules()
    {
        $rules = array_merge($this->getMutualRules(), [
            [[$this->otherGuidAttribute,
                $this->createdByAttribute],
                'unique',
                'targetAttribute' => [$this->otherGuidAttribute, $this->createdByAttribute]],
        ]);
        return $rules;
    }
731420
public static function getAllInstances()
    {
        try {
            $instances = array();

            foreach (static::getAllNames() as $name) {
                $instances[] = static::byName($name);
            }

            return $instances;
        } catch (Enum\Exception\InvalidInstance $e) {
            throw new LogicException("All valid names should produce valid instances?");
        }
    }
1018072
public function validated(): array
    {
        $rules = $this->container->call([$this, 'rules']);

        return $this->only(collect($rules)->keys()->map(function ($rule) {
            return str_contains($rule, '.') ? explode('.', $rule)[0] : $rule;
        })->unique()->toArray());
    }
1031543
public function rules() {
		$args = array();

		foreach ( $this->rules as $arg => $validation ) {
			if ( ! $validation || ! is_string( $validation ) ) {
				continue;
			}

			$args[ $arg ] = $this->parse_validation( $validation );
		}

		return $args;
	}
1255975
public function rules()
    {
        $attributes = [
            'title' => 'required',
            'text'  => 'required',
        ];

        $rules = $this->buildLocalizedRules($attributes);

        return array_merge($rules, [
            'id'           => 'exists:site_pages,id',
            'slug'         => 'required|alpha_dash|unique:site_pages,slug,'.$this->route('sites'),
            'published_at' => 'date',
            'concealed_at' => 'date',
        ]);
    }
265622
protected function _getRules() {
        $relation = $this->getRelation();
        $localModel = $relation->getLocalModel();

        $hasNameConflict = $relation->name === $localModel->id;
        if ($hasNameConflict) {
            return array($relation->name . '1', $relation->name . '2');
        }

        $modelIds = $this->_getModelIdsAlphabetically();

        $rules = array($relation->name, $this->_getSecondRule());
        $rules = $this->_sortRulesEgocentrically($rules);

        return $rules;
    }
699965
public function evaluateRules()
    {
        foreach ($this->rules as $rule => $condition) {
            $this->rules[$rule] = $this->conditions->is($rule, $condition);
        }

        return $this->rules;
    }
1030089
public function rules()
    {
        $modelManager = app(AdminManager::class)->getAdminInstance();
        $modelManager->find(\Route::current()->parameter('one'));

        return $modelManager->getUpdateRules();
    }
1224614
public function rules() {
        return [
            'processRequired' => [['code', 'name', 'flag', 'is_active'], 'required', 'on' => ['create', 'update']],
            'searchSafe' => [['code', 'name', 'is_active'], 'safe', 'on' => ['search']],
            'codeUnique' => ['code', 'unique',
                'targetClass' => Language::className(),
                'message' => Yii::t('multilang', 'Code must be unique'),
                'when' => function($model, $attribute) {
                    return $model->{$attribute} != $model->getOldAttribute($attribute);
                }, 'on' => ['create', 'update']],
        ];
    }
399332
public function rules()
    {
        $rules = [];
        foreach ($this->assocConfig(true) as $key => $data) {
            if (empty($data['rules'])) {
                continue;
            }
            $rules[str_replace('.', '|', $key)] = $data['rules'];
        }

        return $rules;
    }
1165814
public function rules()
    {
        $model = new User();
        $rules = $model->getRulesUpdate();
        $rules['email'] = str_replace('{id}', $this->route()->getParameter('user'), $rules['email']);

        return $rules;
    }
1083596
public function rules()
    {
        $module = UsersModule::module();
        $rules = [
            [
                ['phone'],
                'safe',
            ],
            [
                [
                    'password',
                ],
                'safe',
                'on' => self::SCENARIO_DEFAULT,
            ],
            [
                [
                    'password',
                ],
                'required',
                'on' => self::SCENARIO_PASSWORD_RESET,
            ],
            [
                'username',
                'unique',
            ],
            [
                'email',
                'unique',
            ],
            'standardEmailRules' => [
                [
                    'email',
                ],
                'email',
                'checkDNS' => $module->authorizationScenario()->emailCheckDNS,
                'enableIDN' => $module->authorizationScenario()->emailEnableIDN,
                'skipOnEmpty' => true,
                'on' => self::SCENARIO_PROFILE_UPDATE,
            ],
            'trimEmail' => [
                [
                    'email',
                ],
                'filter',
                'filter' => 'trim',
                'on' => self::SCENARIO_PROFILE_UPDATE,
            ],
            [
                [
                    'username_is_temporary',
                    'password_is_temporary',
                    'is_active',
                ],
                'filter',
                'filter' => 'boolval',
            ]
        ];
        $property_rules = $this->propertiesRules();
        if (!empty($property_rules)) {
            $rules = array_merge($rules, $property_rules);
        }
        if (count(UsersModule::module()->requiredUserAttributes) > 0) {
            $rules['requiredAttributes'] = [
                UsersModule::module()->requiredUserAttributes,
                'required',
                'on' => self::SCENARIO_PROFILE_UPDATE,
            ];
        }


        return $rules;
    }
737842
public function rules()
    {
        $validationRule = [];
        $validationRule['name'] = 'required|max:255';
        $validationRule['content'] = 'required';
        if ($this->getMethod() == 'POST') {
            $validationRule['slug'] = 'required|max:255|alpha_dash|unique:pages';
        }
        if ($this->getMethod() == 'PUT') {
            $validationRule['slug'] = 'required|max:255|alpha_dash';
        }

        return $validationRule;
    }
994927
private function getInstances()
    {
        $response = $this->call($this->tyrUrl . '/' . $this->version . '/instances/');

        $instancesN = json_decode($response);
        if (is_array($instancesN)) {
            $instances = array();
            foreach ($instancesN as $instance) {
                $instances[$instance->id] = $instance->name;
            }
        }

        return $instances;
    }
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;
    }
57754
public function actionRefresh(): array
    {
        $model = Yii::createObject($this->modelClass);
        $model->invalidate();

        return $model->getAvailableAndAssignedRoutes();
    }