Skip to content

Commit a23fdf4

Browse files
committed
WIP
1 parent 70ca3a1 commit a23fdf4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+102
-13
lines changed

src/Functional/Average.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*
1818
* @param iterable<array-key, numeric|mixed> $collection
1919
* @return numeric|null
20+
* @psalm-pure
2021
*/
2122
function average($collection)
2223
{

src/Functional/ButLast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
namespace Functional;
1212

1313
use Functional\Exceptions\InvalidArgumentException;
14-
use Traversable;
1514

1615
/**
1716
* Returns an array containing the elements of the list without its last element.
@@ -20,6 +19,7 @@
2019
* @template TValue of mixed
2120
* @param iterable<TKey, TValue> $collection
2221
* @return array<TKey, TValue>
22+
* @psalm-pure
2323
*/
2424
function but_last($collection)
2525
{

src/Functional/Capture.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* @param-out TResult $result
2020
* @param TResult $result
2121
* @return callable(...TArg): TResult
22+
* @psalm-pure
2223
*/
2324
function capture(callable $callback, &$result)
2425
{

src/Functional/CompareObjectHashOn.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* @param callable(TCompVal, TCompVal): int $comparison A function that compares the two values. Pick e.g. `strcmp()` or `strnatcasecmp()`
2020
* @param callable(TObjIn): TObjOut $keyFunction A function that takes an argument and returns the value that should be compared
2121
* @return callable(TObjIn, TObjIn): int
22+
* @psalm-pure
2223
*/
2324
function compare_object_hash_on(callable $comparison, callable $keyFunction = null)
2425
{

src/Functional/CompareOn.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* @param callable(TVal): TCompVal $reducer A function that takes an argument and returns the value that should be compared
2020
* @return callable(TVal, TVal): int
2121
* @fixme file psalm issue for "Argument 1 expects empty, … provided" (when not passing a reducer)
22+
* @psalm-pure
2223
*/
2324
function compare_on(callable $comparison, callable $reducer = null): callable
2425
{

src/Functional/Compose.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*
1616
* @param callable ...$functions
1717
* @return callable
18+
* @psalm-pure
1819
*/
1920
function compose(callable ...$functions): callable
2021
{

src/Functional/Concat.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*
1616
* @param string $strings
1717
* @return string
18+
* @psalm-pure
1819
*/
1920
function concat(string ...$strings)
2021
{

src/Functional/ConstFunction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* @template T
1717
* @param T $value
1818
* @return callable(): T
19+
* @psalm-pure
1920
*/
2021
function const_function($value)
2122
{

src/Functional/Contains.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
namespace Functional;
1212

1313
use Functional\Exceptions\InvalidArgumentException;
14-
use Traversable;
1514

1615
/**
1716
* Returns true if the collection contains the given value. If the third parameter is
@@ -22,6 +21,7 @@
2221
* @param TLookup $value
2322
* @param bool $strict
2423
* @return bool
24+
* @psalm-pure
2525
*/
2626
function contains($collection, $value, $strict = true)
2727
{

src/Functional/Converge.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param callable(...TBranchReturn): TConvergeReturn $convergingFunction Will be invoked with the return values of all branching functions as its arguments
2424
* @param list<TConvergeFn> $branchingFunctions A list of functions
2525
* @return callable(...TArg): TConvergeReturn
26+
* @psalm-pure
2627
*/
2728
function converge($convergingFunction, array $branchingFunctions): callable
2829
{

0 commit comments

Comments
 (0)