Skip to content

v12.2.0 Make the constructor automatically set the discriminator value

Choose a tag to compare

@github-actions github-actions released this 31 Oct 06:13
· 104 commits to master since this release
Immutable release. Only release title and notes can be modified.
96e06a1

What's Changed

  • Make the constructor automatically set the discriminator value by @eucyt in #752

Previously, when creating a polymorphic model, you have to set the discriminator value manually each time, even though the value is obvious.

$message = (new TextMessage())
  ->setType(\LINE\Constants\MessageType::TEXT) // this is redundant.
  ->setText('hello!');

With this release, the discriminator value will be automatically set in the constructor.

$message = (new TextMessage())
  ->setText('hello!');

$this->assertEquals('text', $message->getType()); // Passed

Dependency updates

  • chore(deps): update dependency node to v24 by @renovate[bot] in #751

Full Changelog: v12.1.0...v12.2.0


This release is prepared by @eucyt