We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Creating an input with type and contraints defined It fails to assert that the type is correct.
public function testOverride() { $input = [ 'price' => 'igor' ]; $inputHandler = new TestConstraintOverrideType(); $inputHandler->bind($input); $this->assertFalse($inputHandler->isValid()); } class TestConstraintOverrideType extends InputHandler { public function define() { $this->add('price', 'int', [ 'required' => true, 'constraints' => [new Range(0)] ]); } }
The text was updated successfully, but these errors were encountered:
igordrnobrega@e04117a
Sorry, something went wrong.
Creating an input with type and contraints defined It fails to assert that the type is correct
The issue is here: https://github.com/LinioIT/input/blob/master/src/Node/BaseNode.php#L68 and https://github.com/LinioIT/input/blob/master/src/Node/BaseNode.php#L161.
The issue is that if the configuration has constraints, it calls setContraints which overrides what is added in the node's constructor.
setContraints
Don't override node constraints.
2b13f4f
Fixes #21.
No branches or pull requests
Creating an input with type and contraints defined It fails to assert that the type is correct.
The text was updated successfully, but these errors were encountered: