Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BaseStringUtils.php
Go to the documentation of this file.
1 <?php
8 
11 
16 {
20  private $booleanUtils;
21 
27  public function __construct(BooleanUtils $booleanUtils)
28  {
29  $this->booleanUtils = $booleanUtils;
30  }
31 
37  public function evaluate(array $data)
38  {
39  if (isset($data['value'])) {
40  $result = $data['value'];
41  if (!is_string($result)) {
42  throw new \InvalidArgumentException('String value is expected.');
43  }
44  } else {
45  $result = '';
46  }
47 
48  return $result;
49  }
50 }