github CuyZ/Valinor 0.15.0

latest releases: 1.14.1, 1.14.0, 1.13.0...
2 years ago

Notable changes

Two similar features are introduced in this release: constants and enums wildcard notations. This is mainly useful when several cases of an enum or class constants share a common prefix.

Example for class constants:

final class SomeClassWithConstants
{
    public const FOO = 1337;

    public const BAR = 'bar';

    public const BAZ = 'baz';
}

$mapper = (new MapperBuilder())->mapper();

$mapper->map('SomeClassWithConstants::BA*', 1337); // error
$mapper->map('SomeClassWithConstants::BA*', 'bar'); // ok
$mapper->map('SomeClassWithConstants::BA*', 'baz'); // ok

Example for enum:

enum SomeEnum: string
{
    case FOO = 'foo';
    case BAR = 'bar';
    case BAZ = 'baz';
}

$mapper = (new MapperBuilder())->mapper();

$mapper->map('SomeEnum::BA*', 'foo'); // error
$mapper->map('SomeEnum::BA*', 'bar'); // ok
$mapper->map('SomeEnum::BA*', 'baz'); // ok

Full list of changes

Features

  • Add support for class constant type (1244c2)
  • Add support for wildcard in enumeration type (69ebd1)
  • Introduce utility class to build messages (cb8792)

Bug Fixes

  • Add return types for cache implementations (0e8f12)
  • Correctly handle type inferring during mapping (37f96f)
  • Fetch correct node value for children (3ee526)
  • Improve scalar values casting (212b77)
  • Properly handle static anonymous functions (c009ab)

Other

  • Import namespace token parser inside library (0b8ca9)
  • Remove unused code (b2889a, de8aa9)
  • Save type token symbols during lexing (ad0f8f)

Don't miss a new Valinor release

NewReleases is sending notifications on new releases.