Skip to content

v1.2.0 - Immutable Variables

Compare
Choose a tag to compare
@WendellAdriel WendellAdriel released this 13 Jun 09:25
· 16 commits to main since this release
9304fd0

Changes

  • Added support for creating immutable variables
  • Added PHPStan integration

Extended Docs

If you want to create immutable variables, you can use the ->immutable() method. If you try to assign a new value to an Immutable Variable, an Strictus\Exceptions\ImmutableStrictusException exception will be thrown:

$immutableScore = Strictus::int(100)->immutable();

$immutableScore(50); //ImmutableStrictusException
$immutableScore->value = 50; //ImmutableStrictusException