| @@ 112-128 (lines=17) @@ | ||
| 109 | ||
| 110 | /** |
|
| 111 | */ |
|
| 112 | public function toString(array $options=[]) |
|
| 113 | { |
|
| 114 | try { |
|
| 115 | $class = get_called_class(); |
|
| 116 | ||
| 117 | $operator = $class::operator; |
|
| 118 | ||
| 119 | $stringified_limits = '[' . implode(', ', array_map(function($limit) { |
|
| 120 | return var_export($limit, true); |
|
| 121 | }, $this->getValues()) ) .']'; |
|
| 122 | ||
| 123 | return "['{$this->getField()}', '$operator', $stringified_limits]"; |
|
| 124 | } |
|
| 125 | catch (\LogicException $e) { |
|
| 126 | return parent::toString(); |
|
| 127 | } |
|
| 128 | } |
|
| 129 | ||
| 130 | /**/ |
|
| 131 | } |
|
| @@ 151-165 (lines=15) @@ | ||
| 148 | /** |
|
| 149 | * @todo cache support |
|
| 150 | */ |
|
| 151 | public function toString(array $options=[]) |
|
| 152 | { |
|
| 153 | try { |
|
| 154 | $operator = self::operator; |
|
| 155 | ||
| 156 | $stringified_possibilities = '[' . implode(', ', array_map(function($possibility) { |
|
| 157 | return var_export($possibility, true); |
|
| 158 | }, $this->getPossibilities()) ) .']'; |
|
| 159 | ||
| 160 | return "['{$this->getField()}', '$operator', $stringified_possibilities]"; |
|
| 161 | } |
|
| 162 | catch (\LogicException $e) { |
|
| 163 | return parent::toString(); |
|
| 164 | } |
|
| 165 | } |
|
| 166 | ||
| 167 | /**/ |
|
| 168 | } |
|