Skip to content

Commit

Permalink
upgrade to PHP8.1 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosh committed Sep 27, 2023
1 parent 013ed96 commit 3002834
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 25 deletions.
6 changes: 1 addition & 5 deletions src/Instances/ConstantSemigroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@
*/
final class ConstantSemigroup implements Semigroup
{
/** @var A */
private $c;

/**
* @param A $c
*/
public function __construct($c)
public function __construct(private readonly $c)
{
$this->c = $c;
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Instances/Either/EitherAlt.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@
*/
final class EitherAlt implements Alt
{
/** @var Semigroup<E> */
private Semigroup $eSemigroup;

/**
* @param Semigroup<E> $eSemigroup
*/
public function __construct(Semigroup $eSemigroup)
public function __construct(private readonly Semigroup $eSemigroup)
{
$this->eSemigroup = $eSemigroup;
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Instances/Either/EitherPlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
*/
final class EitherPlus implements Plus
{
/** @var Monoid<E> */
private Monoid $eMonoid;

/**
* @param Monoid<E> $eMonoid
*/
public function __construct(Monoid $eMonoid)
public function __construct(private readonly Monoid $eMonoid)
{
$this->eMonoid = $eMonoid;
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Instances/OppositeMonoid.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@
*/
final class OppositeMonoid implements Monoid
{
/** @var Monoid<A> */
private Monoid $monoid;

/**
* @param Monoid<A> $monoid
*/
public function __construct(Monoid $monoid)
public function __construct(private readonly Monoid $monoid)
{
$this->monoid = $monoid;
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Instances/OppositeSemigroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@
*/
final class OppositeSemigroup implements Semigroup
{
/** @var Semigroup<A> */
private Semigroup $semigroup;

/**
* @param Semigroup<A> $semigroup
*/
public function __construct(Semigroup $semigroup)
public function __construct(private readonly Semigroup $semigroup)
{
$this->semigroup = $semigroup;
}

/**
Expand Down

0 comments on commit 3002834

Please sign in to comment.