Skip to content

Changelog 0.15.0 — 6th of October 2022

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

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)
Back to top