Skip to content

Commit

Permalink
Merge branch '4.4' into 5.0
Browse files Browse the repository at this point in the history
* 4.4:
  [Validator] Fix auto-mapping constraints should not be validated
  [Debug] Updated the README to deprecate the component
  [Cache] fix memory leak when using PhpFilesAdapter
  [Yaml] Implement multiline string as scalar block for tagged values
  [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
  [FrameworkBundle] Use UserInterface to @return in getUser method
  [CI] Replace php7.4snapshot with php7.4 in Travis configuration
  [ExpressionLanguage][Node][BinaryNode] Process division by zero
  Fixing bad order of operations with null coalescing operator
  forward caught exception
  [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
  add tags before processing them
  [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
  [Process] change the syntax of portable prepared command lines
  [MonologBridge] Fix debug processor datetime type
  • Loading branch information
nicolas-grekas committed Dec 10, 2019
2 parents 121ece2 + 539e7ff commit 412c7cc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Node/BinaryNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,16 @@ public function evaluate(array $functions, array $values)
case '*':
return $left * $right;
case '/':
if (0 == $right) {
throw new \DivisionByZeroError('Division by zero');
}

return $left / $right;
case '%':
if (0 == $right) {
throw new \DivisionByZeroError('Modulo by zero');
}

return $left % $right;
case 'matches':
return preg_match($right, $left);
Expand Down

0 comments on commit 412c7cc

Please sign in to comment.