Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gabfr committed Aug 5, 2020
1 parent 3a6e1f5 commit 9b4f98d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/Node/BaseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ protected function checkConstraints(string $field, $value): void

private function checkIfFieldValueIsSpecified($value): bool
{
return ($this->type === 'string' || $this->type === 'array' ? !empty($value) : !is_null($value));
return $this->type === 'string' || $this->type === 'array' ? !empty($value) : $value !== null;
}

private function setHandler(InputHandler $handler, string $type): self
Expand Down
2 changes: 0 additions & 2 deletions tests/Node/BaseNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,9 @@ public function testNotRequiredWithContraintsAndIntegerField(): void
->addConstraint(new Range(1, 255))
->setType('integer');


$this->assertEmpty($child->getValue('foobar', null));

$this->expectException(InvalidConstraintException::class);
$child->getValue('foobar', 0);

}
}

0 comments on commit 9b4f98d

Please sign in to comment.