Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Boolean.php
Go to the documentation of this file.
1 <?php
7 
10 
14 class Boolean implements InterpreterInterface
15 {
19  private $booleanUtils;
20 
24  public function __construct(BooleanUtils $booleanUtils)
25  {
26  $this->booleanUtils = $booleanUtils;
27  }
28 
34  public function evaluate(array $data)
35  {
36  if (!isset($data['value'])) {
37  throw new \InvalidArgumentException('Boolean value is missing.');
38  }
39  $value = $data['value'];
40  return $this->booleanUtils->toBoolean($value);
41  }
42 }
$value
Definition: gender.phtml:16