Skip to content

Releases: wrk-flow/php-get-typed-value

v0.6.1

17 Aug 09:53
3ea2a5c
Compare
Choose a tag to compare

🚀 Allow passing transformer object instead of closure usingGetValueTransformerContract. Docs
💪 Get value with object transforming to desired type (using GetValueTransformerContract) with correct type hint. Docs

Full Changelog: v0.6.0...v0.6.1

v0.6.0

15 Aug 13:14
6fd0ce9
Compare
Choose a tag to compare

🚀 Improved XML support

  • GetterTransformer - Wraps value into GetValue instance (xml or array)
  • getRequiredXMLGetter, getXMLAttributesGetter, getNullableXMLGetter, getXMLGetter, getRequiredXML, getNullableXML methods

🛠 Breaking change (minor)

  • ArrayGetterTransformer renamed to GetterTransformer. This class was not documented.

Full Changelog: v0.5.1...v0.6.0

v0.5.1

05 Jul 15:39
b756f82
Compare
Choose a tag to compare

⛑ Allow usage of Array*Transformers in all get* methods
🚀 Ignore null values while re-building an array (ArrayItemTransformer, ArrayItemGetterTransformer)

🛠 Breaking change

  • TransformerArrayContract removed

Full Changelog: v0.5.0...v0.5.1

v0.5.0

30 Jun 15:02
662ac6e
Compare
Choose a tag to compare

🚀 Add safe dot annotation for accessing values from child arrays. Documentation
🛠 Key contains parent key for exceptions that were thrown from GetValue instances that were created as child instances.

Breaking changes

  • AbstractGetValueException has new required argument in constructor - $key
  • If you are extending GetValue: $key argument accepts string|array instead of string.

Full Changelog: v0.4.4...v0.5.0

v0.4.4

29 Jun 15:54
277df35
Compare
Choose a tag to compare

⛑ Fix ArrayGetterTransformer closure type hints for PHPStan

Full Changelog: v0.4.3...v0.4.4

v0.4.3

29 Jun 15:21
69bc6e4
Compare
Choose a tag to compare

🚀 Add support for enums: get methods, EnumRule.

v0.4.2

29 Jun 14:10
1289384
Compare
Choose a tag to compare

⛽️ Add ability to validate HEX colors using HexColorRule. Documentation.

Full Changelog: v0.4.1...v0.4.2

v0.4.1

29 Jun 13:36
b5e6c9a
Compare
Choose a tag to compare

🚀 Add ArrayGetterTransformer to get array object wrapped in GetValue Documentation

Full Changelog: v0.4.0...v0.4.1

v0.4.0

29 Jun 09:46
4c44a6b
Compare
Choose a tag to compare

🚀 Add array item transformer that has wrapped array value in GetValue instance. Documentation

$transformer = new ArrayItemGetterTransformer( function (\Wrkflow\GetValue\GetValue $value, string $key): string {
    return [
        self::KeyValue => $value->getRequiredString(self::KeyValue),
    ];
});

$values = $getValue->getArray('key', [$transformer]);

🛠 $getValue->makeInstance will allow you to create new instance of GetValue with same strategy/builder/actions.

Breaking changes

Critical

  • Renamed ClosureArrayItemsTransformer to ArrayItemTransformer
  • Renamed ClosureArrayTransformer to ArrayTransformer

Minor

  • Transformers transform method has new parameter GetValue $getValue - update your transformers or transform calls.
public function transform(mixed $value, string $key, GetValue $getValue): mixed

v0.3.1

28 Jun 16:32
c94ee4d
Compare
Choose a tag to compare

🚀 Array closures transformers Documentation