Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: php-type-language/mapper

0.5.0

01 Oct 19:13
@SerafimArts SerafimArts

Choose a tag to compare

0.5.0 Pre-release
Pre-release
  • Added asymmetric read/write support for reflection driver:
class Example
{
 // The mapper inferences:
 // - Type "string" for reading (normalization)
 // - Type "string|\Stringable" for writing (denormalization)
 public string $name {
 get => $this->name;
 set(string|\Stringable $name) => (string) $name;
 }
}
  • Added asymmetric read/write support for attribute driver:
class Example
{
 #[MapType('T')] // Inferences T for read + write
 public string $name {
 #[MapType('U')] // Inferences T for reading (normalization)
 get => $this->name;
 #[MapType('V')] // Inferences V for writing (denormalization)
 set(string|\Stringable $name) => (string) $name;
 }
}
  • Added support for custom error messages:
class Example
{
 #[OnTypeError(message: 'Name must be a string')]
 #[OnUndefinedError(message: 'Name is required')]
 public string $name;
}
// If specified via configs:
// 'properties' => [
// 'name' => [
// 'type_error_message' => 'Name must be a string',
// 'undefined_error_message' => 'Name is required',
// ],
// ...
  • In case of empty object received, an error is now thrown indicating that it is an object {}, not an array [] as before.
  • And more...

Full Changelog: 0.4.1...0.5.0

Loading

0.4.1

03 Sep 16:39
@SerafimArts SerafimArts

Choose a tag to compare

0.4.1 Pre-release
Pre-release
  • Fix class inheritance
  • Actualize and fix linter issues

Full Changelog: 0.4.0...0.4.1

Loading

0.4.0

14 Jan 04:10
@SerafimArts SerafimArts

Choose a tag to compare

0.4.0 Pre-release
Pre-release
  • Added CallableTypeBuilder (see: #1)
  • Added support of TypeLang v1.4
  • Added stricter class type checks

New Contributors

Full Changelog: 0.3.0...0.4.0

Contributors

root-aza
Loading

0.3.0

09 Dec 13:21
@SerafimArts SerafimArts

Choose a tag to compare

0.3.0 Pre-release
Pre-release
  • Added objects subtype normalization.
  • Added Mapper::getType() and Mapper::getTypeByValue() public methods.
  • Added array-like metadata drivers (with JSON Schema validation).
  • A little more improvements

Full Changelog: 0.2.0...0.3.0

Loading
root-aza reacted with rocket emoji
1 person reacted

0.2.0

20 Nov 01:58
@SerafimArts SerafimArts

Choose a tag to compare

0.2.0 Pre-release
Pre-release

Features

  • Added discriminator mapping (see #[DiscriminatorMap] attribute).
  • Added property name mapping (see #[MapName] attribute).
  • Added localobject "normalize as array" option (see #[NormalizeAsArray] attribute).
  • Added object normalization property skipping options:
    • See #[SkipWhen] for using skipping expressions.
    • See #[SkipWhenEmpty] for empty(T) skipping expression.
    • See #[SkipWhenNull] for T === null skipping expression.
  • The #[MapProperty] attribute renamed to #[MapType].
  • Added debug tracing and logging options.
    • Use Configuration::$logger option for logger.
    • Use Configuration::$tracer option for tracing.
  • Added value casting: Values ​​for normalization are now trusted by default and attempt to convert to the specified type, instead of strictly checking.

    See https://github.com/php-type-language/mapper/tree/master/tests/Feature/Type files for more information on the casting rules.

    • Use Configuration::$strictTypes option to enable or disable casting mode.

Types

  • Added boolean alias of bool type.
  • Added integer alias of int type.
  • Added double and real aliases of float type.
  • Added iterable, Iterator, Generator, Traversable and IteratorAggregate aliases for array normalization.
  • Added object and stdClass types.
  • Added UnitEnumType support.
  • Temporary removed non-standard non-empty-string, numeric-string, class-string, positive-int, non-negative-int, negative-int and non-positive-int. Please temporarily add aliases to the string and int for them.

Other

  • All runtime (mapping) exceptions and their hierarchy have been rewritten.
  • All kernel have been rewritten (there are too many changes to list it all).

Full Changelog: 0.1.0...0.2.0

Loading

0.1.0

16 Oct 09:26
@SerafimArts SerafimArts

Choose a tag to compare

0.1.0 Pre-release
Pre-release

Please note, this is a pre-release to freeze the stable version, prepare documentation and evaluate the functionality.

Please wait for the major version 1.0.0 if you want to use it in production.
There may be backward compatibility breaks between minor versions 0.x!

Loading
SerafimArts reacted with hooray emoji
1 person reacted

AltStyle によって変換されたページ (->オリジナル) /