Skip to content

Commit

Permalink
Merge pull request #51 from sanmai/totallyTyped
Browse files Browse the repository at this point in the history
Update psalm.xml
  • Loading branch information
sanmai committed Oct 12, 2018
2 parents 6abe890 + f7b2318 commit 1f7f5dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion psalm.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<psalm
totallyTyped="false"
totallyTyped="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down
9 changes: 9 additions & 0 deletions src/Principal.php
Expand Up @@ -49,6 +49,7 @@ public function __construct(\Traversable $input = null)
* {@inheritdoc}
*
* @param callable $func {@inheritdoc}
* @psalm-suppress MixedAssignment
*
* @return $this
*/
Expand Down Expand Up @@ -79,6 +80,13 @@ public function map(callable $func)
return $this;
}

/**
* @param iterable|\Traversable|array $previous
* @param callable $func
* @psalm-suppress MixedAssignment
*
* @return \Generator
*/
private static function apply(/* iterable */ $previous, callable $func): \Generator
{
foreach ($previous as $value) {
Expand Down Expand Up @@ -166,6 +174,7 @@ public function toArray(): array
*
* @param callable $func {@inheritdoc}
* @param mixed $initial {@inheritdoc}
* @psalm-suppress MixedAssignment
*
* @return mixed|null
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Standard.php
Expand Up @@ -37,6 +37,7 @@ public function unpack(callable $func = null): self
yield from $args;
};

/** @psalm-suppress MixedArgument */
return $this->map(static function (/* iterable */ $args = null) use ($func) {
return $func(...$args ?? []);
});
Expand Down Expand Up @@ -96,6 +97,7 @@ public function reduce(callable $func = null, $initial = null)
{
if (is_null($func)) {
return parent::reduce(static function ($carry, $item) {
/** @psalm-suppress MixedOperand */
$carry += $item;

return $carry;
Expand Down

0 comments on commit 1f7f5dd

Please sign in to comment.