v12.2.0 Make the constructor automatically set the discriminator value
·
104 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
What's Changed
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()); // PassedDependency updates
Full Changelog: v12.1.0...v12.2.0
This release is prepared by @eucyt