Skip to content

Commit

Permalink
Merge pull request #102 from ilario-pierbattista/ilario-pierbattista-…
Browse files Browse the repository at this point in the history
…fix-all-return-typehints

Fix all return typehints in php doc
  • Loading branch information
widmogrod authored Nov 6, 2019
2 parents 011a080 + 85d6ced commit b7ce6da
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 45 deletions.
8 changes: 4 additions & 4 deletions src/Functional/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function foldr(callable $callable, $accumulator = null, Foldable $foldable = nul
* @param callable $predicate
* @param Foldable $list
*
* @return Foldable
* @return Foldable|\Closure
*/
function filter(callable $predicate, Foldable $list = null)
{
Expand Down Expand Up @@ -497,7 +497,7 @@ function liftA2(
* @param Monad $a
* @param Monad $b
*
* @return Monad
* @return Monad|\Closure
*/
function sequenceM(Monad $a, Monad $b = null): Monad
{
Expand Down Expand Up @@ -525,7 +525,7 @@ function sequenceM(Monad $a, Monad $b = null): Monad
* @param callable $transformation (a -> f b)
* @param Traversable $t t a
*
* @return Applicative f (t b)
* @return \Closure|Applicative f (t b)
*/
function traverse(callable $transformation, Traversable $t = null)
{
Expand All @@ -548,7 +548,7 @@ function traverse(callable $transformation, Traversable $t = null)
* @param callable $f (a -> m Bool)
* @param Foldable $xs [a]
*
* @return Monad m [a]
* @return \Closure|Monad m [a]
*/
function filterM(callable $f, Foldable $xs = null)
{
Expand Down
14 changes: 7 additions & 7 deletions src/Functional/infinit.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* ```haskell
* iterate f x == [x, f x, f (f x), ...]
* ```
* @param callable $fn
* @param mixed $a
* @return Listt
* @param callable $fn
* @param mixed $a
* @return Listt|\Closure
*/
function iterate(callable $fn, $a = null)
{
Expand All @@ -46,7 +46,7 @@ function iterate(callable $fn, $a = null)
* repeat x is an infinite list, with x the value of every element.
*
* @param $a
* @return mixed|ListtCons
* @return ListtCons
*/
function repeat($a)
{
Expand All @@ -66,9 +66,9 @@ function repeat($a)
* replicate n x is a list of length n with x the value of every element.
* It is an instance of the more general genericReplicate, in which n may be of any integral type.
*
* @param int $n
* @param mixed $a
* @return Listt
* @param int $n
* @param mixed $a
* @return Listt|\Closure
*/
function replicate(int $n, $a = null): Listt
{
Expand Down
6 changes: 3 additions & 3 deletions src/Functional/listt.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ function concat(Foldable $xs): Listt
/**
* prepend :: a -> [a] -> [a]
*
* @param mixed $x
* @param Listt $xs
* @return Listt
* @param mixed $x
* @param Listt $xs
* @return Listt|\Closure
*/
function prepend($x, Listt $xs = null)
{
Expand Down
8 changes: 4 additions & 4 deletions src/Functional/monoid.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ function emptyM(Monoid $a): Monoid
/**
* concatM :: a -> a -> a
*
* @param Semigroup $a
* @param Semigroup $b
* @param Semigroup $a
* @param Semigroup|null $b
*
* @return Semigroup
* @return Semigroup|\Closure
*/
function concatM(Semigroup $a, Semigroup $b)
function concatM(Semigroup $a, Semigroup $b = null)
{
return curryN(2, function (Semigroup $a, Semigroup $b) {
return $a->concat($b);
Expand Down
12 changes: 6 additions & 6 deletions src/Functional/predicates.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
* @param mixed $expected
* @param mixed $value
*
* @return mixed
* @return bool|\Closure
*/
function eql($expected, $value = null)
{
return curryN(2, function ($expected, $value) {
return curryN(2, function ($expected, $value): bool {
return $expected === $value;
})(...func_get_args());
}
Expand All @@ -29,11 +29,11 @@ function eql($expected, $value = null)
* @param mixed $expected
* @param mixed $value
*
* @return mixed
* @return bool|\Closure
*/
function lt($expected, $value = null)
{
return curryN(2, function ($expected, $value) {
return curryN(2, function ($expected, $value): bool {
return $value < $expected;
})(...func_get_args());
}
Expand All @@ -48,11 +48,11 @@ function lt($expected, $value = null)
* @param callable|null $predicateB
* @param mixed $value
*
* @return mixed
* @return bool|\Closure
*/
function orr(callable $predicateA, callable $predicateB = null, $value = null)
{
return curryN(3, function (callable $a, callable $b, $value) {
return curryN(3, function (callable $a, callable $b, $value): bool {
return $a($value) || $b($value);
})(...func_get_args());
}
2 changes: 1 addition & 1 deletion src/Functional/setoid.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @param Setoid $a
* @param Setoid $b
*
* @return bool
* @return bool|\Closure
*/
function equal(Setoid $a, Setoid $b = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Functional/strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
/**
* concatStrings :: String -> String -> String
*
* @param string $a
* @param string $b
* @param string $a
* @param string|null $b
*
* @return string
* @return string|\Closure
*/
function concatStrings($a, $b = null)
{
Expand Down
24 changes: 12 additions & 12 deletions src/Functional/sublist.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*
* take n, applied to a list xs, returns the prefix of xs of length n, or xs itself if n > length xs:
*
* @param int $n
* @param Listt $xs
* @return Listt
* @param int $n
* @param Listt $xs
* @return Listt|\Closure
*/
function take(int $n, Listt $xs = null)
{
Expand All @@ -45,9 +45,9 @@ function take(int $n, Listt $xs = null)
* drop :: Int -> [a] -> [a]
*
* drop n xs returns the suffix of xs after the first n elements, or [] if n > length xs:
* @param int $n
* @param Listt $xs
* @return Listt
* @param int $n
* @param Listt $xs
* @return Listt|\Closure
*/
function drop(int $n, Listt $xs = null)
{
Expand Down Expand Up @@ -80,9 +80,9 @@ function drop(int $n, Listt $xs = null)
* | otherwise = xs
* ```
*
* @param callable $predicate
* @param Listt $xs
* @return Listt
* @param callable $predicate
* @param Listt $xs
* @return Listt|\Closure
*/
function dropWhile(callable $predicate, Listt $xs = null)
{
Expand Down Expand Up @@ -122,9 +122,9 @@ function dropWhile(callable $predicate, Listt $xs = null)
* where first element is longest prefix (possibly empty) of xs of elements
* that satisfy p and second element is the remainder of the list
*
* @param callable $predicate
* @param Listt $xs
* @return array
* @param callable $predicate
* @param Listt $xs
* @return array|\Closure
*/
function span(callable $predicate, Listt $xs = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Functional/zipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* zip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded.
* zip is right-lazy:
*
* @param Listt $xs
* @param Listt|null $ys
* @return Listt
* @param Listt $xs
* @param Listt|null $ys
* @return Listt|\Closure
*/
function zip(Listt $xs, Listt $ys = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Monad/Either/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function either(callable $left, callable $right = null, Either $either = null)
* @param callable $right
* @param Either $either
*
* @return Left|Right
* @return Left|Right|\Closure
*/
function doubleMap(callable $left, callable $right = null, Either $either = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Monad/IO/errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function throwIO(\Exception $e)
* @param M\IO $io
* @param callable $catchFunction
*
* @return M\IO
* @return M\IO|\Closure
*/
function tryCatch(M\IO $io = null, callable $catchFunction = null)
{
Expand Down

0 comments on commit b7ce6da

Please sign in to comment.