Update interface of Setoid
authorwidmogrod <widmogrod@gmail.com>
Sat, 23 Dec 2017 21:21:51 +0000 (22:21 +0100)
committerwidmogrod <widmogrod@gmail.com>
Sat, 23 Dec 2017 21:21:51 +0000 (22:21 +0100)
src/FantasyLand/Semigroup.php
src/FantasyLand/Setoid.php
src/Functional/setoid.php
src/Primitive/ListtCons.php
src/Primitive/ListtNil.php
src/Primitive/Num.php
src/Primitive/Stringg.php

index 26fab9c..1d68ea6 100644 (file)
@@ -11,7 +11,7 @@ interface Semigroup
      *
      * @param Semigroup $value
      *
-     * @return Semigroup
+     * @return self
      */
     public function concat(self $value): self;
 }
index fe61163..1e895ca 100644 (file)
@@ -11,5 +11,5 @@ interface Setoid
      *
      * @return bool
      */
-    public function equals($other);
+    public function equals($other): bool;
 }
index 2f046ef..c4a55ab 100644 (file)
@@ -18,7 +18,7 @@ const equal = 'Widmogrod\Functional\equal';
  */
 function equal(Setoid $a, Setoid $b = null)
 {
-    return curryN(2, function (Setoid $a, Setoid $b) {
+    return curryN(2, function (Setoid $a, Setoid $b):bool {
         return $a->equals($b);
     })(...func_get_args());
 }
index 80fbf68..46ff79d 100644 (file)
@@ -163,7 +163,7 @@ class ListtCons implements Listt, \IteratorAggregate
     /**
      * @inheritdoc
      */
-    public function equals($other)
+    public function equals($other): bool
     {
         return $other instanceof self
             ? $this->extract() === $other->extract()
index 269c4fd..f7ebcf7 100644 (file)
@@ -109,7 +109,7 @@ class ListtNil implements Listt
     /**
      * @inheritdoc
      */
-    public function equals($other)
+    public function equals($other): bool
     {
         return $other instanceof self
             ? true
index cd9096e..674831b 100644 (file)
@@ -20,7 +20,7 @@ class Num implements
     /**
      * @inheritdoc
      */
-    public function equals($other)
+    public function equals($other): bool
     {
         return $other instanceof self
             ? $this->extract() === $other->extract()
index 2536415..a95495a 100644 (file)
@@ -49,7 +49,7 @@ class Stringg implements
     /**
      * @inheritdoc
      */
-    public function equals($other)
+    public function equals($other): bool
     {
         return $other instanceof self
             ? $this->extract() === $other->extract()