1
0
mirror of https://github.com/danog/amp.git synced 2024-12-02 17:37:50 +01:00

Increase psalm error level to level 5

This commit is contained in:
Niklas Keller 2020-03-28 14:25:39 +01:00
parent f8efd44684
commit 71d7f5674c
3 changed files with 14 additions and 2 deletions

View File

@ -15,6 +15,7 @@ use React\Promise\PromiseInterface as ReactPromise;
* before emitting values. * before emitting values.
* *
* @internal * @internal
* @template-covariant TValue
*/ */
trait Producer trait Producer
{ {
@ -41,6 +42,8 @@ trait Producer
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return Promise<bool>
*/ */
public function advance(): Promise public function advance(): Promise
{ {
@ -72,6 +75,8 @@ trait Producer
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return Promise<TValue>
*/ */
public function getCurrent() public function getCurrent()
{ {

View File

@ -2,12 +2,19 @@
namespace Amp; namespace Amp;
/**
* @template-covariant TValue
* @template-implements Iterator<TValue>
*/
final class Producer implements Iterator final class Producer implements Iterator
{ {
/**
* @use Internal\Producer<TValue>
*/
use CallableMaker, Internal\Producer; use CallableMaker, Internal\Producer;
/** /**
* @param callable(callable(mixed $value): Promise $emit): \Generator $producer * @param callable(callable(TValue $value): Promise $emit): \Generator $producer
* *
* @throws \Error Thrown if the callable does not return a Generator. * @throws \Error Thrown if the callable does not return a Generator.
*/ */

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<psalm <psalm
totallyTyped="false" totallyTyped="false"
errorLevel="6" errorLevel="5"
phpVersion="7.0" phpVersion="7.0"
resolveFromConfigFile="true" resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"