Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rules: added reset method #180

Merged
merged 1 commit into from Jun 4, 2018
Merged

Rules: added reset method #180

merged 1 commit into from Jun 4, 2018

Conversation

@f3l1x
Copy link
Member

f3l1x commented May 28, 2018

  • new feature: yes
  • BC break? yno
  • doc PR: not yet

Ability to reset already attached rules on control. It's not possible to attach different rules in modular systems. Or is it?

$form = new Form;
$input = $form->addText('text');
$input->addCondition(Form::MAX_LENGTH, 5)
	->addRule(Form::PATTERN, 'Musí obsahovat číslici', '.*[0-9].*');
$input->getRules()->reset();

Reset method is marked as internal.

@dg

This comment has been minimized.

Copy link
Member

dg commented May 28, 2018

Why internal?

@f3l1x

This comment has been minimized.

Copy link
Member Author

f3l1x commented May 29, 2018

It looks similar as check method. But you're right, it shouldn't be @internal.

@f3l1x

This comment has been minimized.

Copy link
Member Author

f3l1x commented Jun 2, 2018

What do you think @dg ?

@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 3, 2018

I think that you should remove annotation internal, because that method is not used anywhere :)

@f3l1x f3l1x force-pushed the f3l1x:feature/reset-rules branch from 28a7ecc to 4994616 Jun 4, 2018
@f3l1x

This comment has been minimized.

Copy link
Member Author

f3l1x commented Jun 4, 2018

Done.

@dg

This comment has been minimized.

Copy link
Member

dg commented Jun 4, 2018

Great

@dg dg merged commit be85f75 into nette:v2.4 Jun 4, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.006%) to 94.893%
Details
dg added a commit that referenced this pull request Jun 4, 2018
dg added a commit that referenced this pull request Jun 4, 2018
dg added a commit that referenced this pull request Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.