Skip to content

Commit

Permalink
Get rid of all PSalm warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 26, 2020
1 parent 15891b8 commit 4498857
Show file tree
Hide file tree
Showing 55 changed files with 62 additions and 57 deletions.
8 changes: 4 additions & 4 deletions composer.json
Expand Up @@ -22,11 +22,11 @@
"drupol/php-conventions": "^1.7.1",
"friends-of-phpspec/phpspec-code-coverage": "^4.3.2",
"infection/infection": ">= 0.15.3",
"phpbench/phpbench": "^0.17.0",
"phpspec/phpspec": "^6.1.1",
"phpstan/phpstan": "^0.12.29",
"phpbench/phpbench": "^0.17.1",
"phpspec/phpspec": "^6.2",
"phpstan/phpstan": "^0.12.31",
"phpstan/phpstan-strict-rules": "^0.12",
"vimeo/psalm": "^3.11.5"
"vimeo/psalm": "^3.12"
},
"config": {
"sort-packages": true
Expand Down
4 changes: 4 additions & 0 deletions grumphp.yml.dist
Expand Up @@ -4,6 +4,10 @@ imports:
parameters:
process_timeout: 600
extra_tasks:
psalm:
show_info: true
metadata:
priority: 3500
phpspec:
verbose: true
metadata:
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
totallyTyped="true"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down
2 changes: 1 addition & 1 deletion src/Base.php
Expand Up @@ -94,7 +94,7 @@ final public function __construct($data = [], ...$parameters)
}

/**
* @return ClosureIterator<mixed>
* @return ClosureIterator
*/
public function getIterator(): ClosureIterator
{
Expand Down
4 changes: 2 additions & 2 deletions src/Contract/Collection.php
Expand Up @@ -129,7 +129,7 @@ interface Collection extends
/**
* Create a new instance with no items.
*
* @return \loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Contract\Collection
*/
public static function empty(): Collection;

Expand All @@ -139,7 +139,7 @@ public static function empty(): Collection;
* @param mixed $data
* @param mixed ...$parameters
*
* @return \loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Contract\Collection
*/
public static function with($data = [], ...$parameters): Collection;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Appendable.php
Expand Up @@ -16,7 +16,7 @@ interface Appendable
*
* @param mixed ...$items
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function append(...$items): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Applyable.php
Expand Up @@ -16,7 +16,7 @@ interface Applyable
*
* @param callable ...$callables
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function apply(callable ...$callables): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Chunkable.php
Expand Up @@ -16,7 +16,7 @@ interface Chunkable
*
* @param int ...$size
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function chunk(int ...$size): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Collapseable.php
Expand Up @@ -14,7 +14,7 @@ interface Collapseable
/**
* Collapse a collection of items into a simple flat collection.
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function collapse(): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Columnable.php
Expand Up @@ -16,7 +16,7 @@ interface Columnable
*
* @param int|string $index
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function column($index): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Combinateable.php
Expand Up @@ -17,7 +17,7 @@ interface Combinateable
* @param int $length
* The length.
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function combinate(?int $length = null): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Combineable.php
Expand Up @@ -16,7 +16,7 @@ interface Combineable
*
* @param mixed ...$keys
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function combine(...$keys): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Cycleable.php
Expand Up @@ -14,7 +14,7 @@ interface Cycleable
/**
* @param int $length
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function cycle(int $length = 0): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Distinctable.php
Expand Up @@ -14,7 +14,7 @@ interface Distinctable
/**
* Remove duplicated values from a collection.
*
* @return \loophp\collection\Contract\Base<mixed>
* @return \loophp\collection\Contract\Base
*/
public function distinct(): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Explodeable.php
Expand Up @@ -16,7 +16,7 @@ interface Explodeable
*
* @param mixed ...$explodes
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function explode(...$explodes): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Filterable.php
Expand Up @@ -16,7 +16,7 @@ interface Filterable
*
* @param callable ...$callbacks
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function filter(callable ...$callbacks): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Flattenable.php
Expand Up @@ -18,7 +18,7 @@ interface Flattenable
*
* @param int $depth
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function flatten(int $depth = PHP_INT_MAX): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Flipable.php
Expand Up @@ -14,7 +14,7 @@ interface Flipable
/**
* Flip keys and items in a collection.
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function flip(): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Forgetable.php
Expand Up @@ -16,7 +16,7 @@ interface Forgetable
*
* @param string ...$keys
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function forget(...$keys): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Frequencyable.php
Expand Up @@ -9,7 +9,7 @@
interface Frequencyable
{
/**
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function frequency(): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Intersperseable.php
Expand Up @@ -19,7 +19,7 @@ interface Intersperseable
* @param int $every
* @param int $startAt
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function intersperse($element, int $every = 1, int $startAt = 0): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Iterateable.php
Expand Up @@ -15,7 +15,7 @@ interface Iterateable
* @param callable $callback
* @param mixed ...$parameters
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public static function iterate(callable $callback, ...$parameters): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Keysable.php
Expand Up @@ -14,7 +14,7 @@ interface Keysable
/**
* Get the keys of the items.
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function keys(): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Limitable.php
Expand Up @@ -16,7 +16,7 @@ interface Limitable
*
* @param int $limit
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function limit(int $limit): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Loopable.php
Expand Up @@ -12,7 +12,7 @@
interface Loopable
{
/**
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function loop(): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Mapable.php
Expand Up @@ -16,7 +16,7 @@ interface Mapable
*
* @param callable ...$callbacks
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function map(callable ...$callbacks): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Mergeable.php
Expand Up @@ -16,7 +16,7 @@ interface Mergeable
*
* @param iterable<mixed> ...$sources
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function merge(iterable ...$sources): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Normalizeable.php
Expand Up @@ -14,7 +14,7 @@ interface Normalizeable
/**
* Replace, reorder and use numeric keys on a collection.
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function normalize(): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Nthable.php
Expand Up @@ -17,7 +17,7 @@ interface Nthable
* @param int $step
* @param int $offset
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function nth(int $step, int $offset = 0): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Onlyable.php
Expand Up @@ -16,7 +16,7 @@ interface Onlyable
*
* @param mixed ...$keys
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function only(...$keys): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Padable.php
Expand Up @@ -17,7 +17,7 @@ interface Padable
* @param int $size
* @param mixed $value
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function pad(int $size, $value): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Permutateable.php
Expand Up @@ -14,7 +14,7 @@ interface Permutateable
/**
* Find all the permutations of a collection.
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function permutate(): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Pluckable.php
Expand Up @@ -17,7 +17,7 @@ interface Pluckable
* @param array<int, string>|string $pluck
* @param mixed|null $default
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function pluck($pluck, $default = null): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Prependable.php
Expand Up @@ -16,7 +16,7 @@ interface Prependable
*
* @param mixed ...$items
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function prepend(...$items): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Productable.php
Expand Up @@ -16,7 +16,7 @@ interface Productable
*
* @param iterable<mixed> ...$iterables
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function product(iterable ...$iterables): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/RSampleable.php
Expand Up @@ -14,7 +14,7 @@ interface RSampleable
/**
* @param float $probability
*
* @return \loophp\collection\Contract\Base<mixed>
* @return \loophp\collection\Contract\Base
*/
public function rsample($probability): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Rangeable.php
Expand Up @@ -20,7 +20,7 @@ interface Rangeable
* @param float $end
* @param float $step
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public static function range(float $start = 0.0, float $end = INF, float $step = 1.0): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Reductionable.php
Expand Up @@ -17,7 +17,7 @@ interface Reductionable
* @param callable $callback
* @param mixed $initial
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function reduction(callable $callback, $initial = null): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Reverseable.php
Expand Up @@ -14,7 +14,7 @@ interface Reverseable
/**
* Reverse order items of a collection.
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function reverse(): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Scaleable.php
Expand Up @@ -20,7 +20,7 @@ interface Scaleable
* @param float|null $wantedUpperBound
* @param float|null $base
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function scale(
float $lowerBound,
Expand Down
2 changes: 1 addition & 1 deletion src/Contract/Operation/Skipable.php
Expand Up @@ -16,7 +16,7 @@ interface Skipable
*
* @param int ...$counts
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function skip(int ...$counts): Base;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/Sliceable.php
Expand Up @@ -17,7 +17,7 @@ interface Sliceable
* @param int $offset
* @param int|null $length
*
* @return \loophp\collection\Base<mixed>|\loophp\collection\Contract\Collection<mixed>
* @return \loophp\collection\Base|\loophp\collection\Contract\Collection
*/
public function slice(int $offset, ?int $length = null): Base;
}

0 comments on commit 4498857

Please sign in to comment.