ArrayColumn.php
1 year ago
ArrayFlatten.php
1 year ago
ArrayKeys.php
1 year ago
ArraySearch.php
1 year ago
ArrayValues.php
1 year ago
Count.php
1 year ago
DotNotation.php
1 year ago
PrepareUrl.php
1 year ago
TransformerInterface.php
1 year ago
TransformerService.php
1 year ago
TransformerInterface.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers; |
| 4 | |
| 5 | use stdClass; |
| 6 | |
| 7 | /** |
| 8 | * An interface to define a transformer. |
| 9 | * |
| 10 | * Interface TransformerInterface |
| 11 | * |
| 12 | * @package Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers |
| 13 | */ |
| 14 | interface TransformerInterface { |
| 15 | /** |
| 16 | * Transform given value to a different value. |
| 17 | * |
| 18 | * @param mixed $value a value to transform. |
| 19 | * @param stdClass|null $arguments arguments. |
| 20 | * @param string|null $default_value default value. |
| 21 | * |
| 22 | * @return mixed|null |
| 23 | */ |
| 24 | public function transform( $value, ?stdClass $arguments = null, $default_value = null ); |
| 25 | |
| 26 | /** |
| 27 | * Validate Transformer arguments. |
| 28 | * |
| 29 | * @param stdClass|null $arguments arguments to validate. |
| 30 | * |
| 31 | * @return mixed |
| 32 | */ |
| 33 | public function validate( ?stdClass $arguments = null ); |
| 34 | } |
| 35 |