From 2d2760e15c76139cbce6eb519f622802f1f1007e Mon Sep 17 00:00:00 2001 From: Fabio Ivona Date: Mon, 29 Nov 2021 09:52:18 +0100 Subject: [PATCH] fix phpstan --- src/CoreExpectation.php | 100 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/src/CoreExpectation.php b/src/CoreExpectation.php index c95e5505..153a935d 100644 --- a/src/CoreExpectation.php +++ b/src/CoreExpectation.php @@ -52,6 +52,8 @@ final class CoreExpectation * Asserts that two variables have the same type and * value. Used on objects, it asserts that two * variables reference the same object. + * + * @return CoreExpectation */ public function toBe(mixed $expected): CoreExpectation { @@ -62,6 +64,8 @@ final class CoreExpectation /** * Asserts that the value is empty. + * + * @return CoreExpectation */ public function toBeEmpty(): CoreExpectation { @@ -72,6 +76,8 @@ final class CoreExpectation /** * Asserts that the value is true. + * + * @return CoreExpectation */ public function toBeTrue(): CoreExpectation { @@ -82,6 +88,8 @@ final class CoreExpectation /** * Asserts that the value is truthy. + * + * @return CoreExpectation */ public function toBeTruthy(): CoreExpectation { @@ -92,6 +100,8 @@ final class CoreExpectation /** * Asserts that the value is false. + * + * @return CoreExpectation */ public function toBeFalse(): CoreExpectation { @@ -102,6 +112,8 @@ final class CoreExpectation /** * Asserts that the value is falsy. + * + * @return CoreExpectation */ public function toBeFalsy(): CoreExpectation { @@ -112,6 +124,8 @@ final class CoreExpectation /** * Asserts that the value is greater than $expected. + * + * @return CoreExpectation */ public function toBeGreaterThan(int|float $expected): CoreExpectation { @@ -122,6 +136,8 @@ final class CoreExpectation /** * Asserts that the value is greater than or equal to $expected. + * + * @return CoreExpectation */ public function toBeGreaterThanOrEqual(int|float $expected): CoreExpectation { @@ -132,6 +148,8 @@ final class CoreExpectation /** * Asserts that the value is less than or equal to $expected. + * + * @return CoreExpectation */ public function toBeLessThan(int|float $expected): CoreExpectation { @@ -142,6 +160,8 @@ final class CoreExpectation /** * Asserts that the value is less than $expected. + * + * @return CoreExpectation */ public function toBeLessThanOrEqual(int|float $expected): CoreExpectation { @@ -152,6 +172,8 @@ final class CoreExpectation /** * Asserts that $needle is an element of the value. + * + * @return CoreExpectation */ public function toContain(mixed ...$needles): CoreExpectation { @@ -173,6 +195,8 @@ final class CoreExpectation /** * Asserts that the value starts with $expected. * + * @return CoreExpectation + * * @param non-empty-string $expected */ public function toStartWith(string $expected): CoreExpectation @@ -189,6 +213,8 @@ final class CoreExpectation /** * Asserts that the value ends with $expected. * + * @return CoreExpectation + * * @param non-empty-string $expected */ public function toEndWith(string $expected): CoreExpectation @@ -204,6 +230,8 @@ final class CoreExpectation /** * Asserts that $number matches value's Length. + * + * @return CoreExpectation */ public function toHaveLength(int $number): CoreExpectation { @@ -234,6 +262,8 @@ final class CoreExpectation /** * Asserts that $count matches the number of elements of the value. + * + * @return CoreExpectation */ public function toHaveCount(int $count): CoreExpectation { @@ -248,6 +278,8 @@ final class CoreExpectation /** * Asserts that the value contains the property $name. + * + * @return CoreExpectation */ public function toHaveProperty(string $name, mixed $value = null): CoreExpectation { @@ -267,6 +299,8 @@ final class CoreExpectation /** * Asserts that the value contains the provided properties $names. * + * @return CoreExpectation + * * @param iterable $names */ public function toHaveProperties(iterable $names): CoreExpectation @@ -280,6 +314,8 @@ final class CoreExpectation /** * Asserts that two variables have the same value. + * + * @return CoreExpectation */ public function toEqual(mixed $expected): CoreExpectation { @@ -296,6 +332,8 @@ final class CoreExpectation * are sorted before they are compared. When $expected and $this->value * are objects, each object is converted to an array containing all * private, protected and public attributes. + * + * @return CoreExpectation */ public function toEqualCanonicalizing(mixed $expected): CoreExpectation { @@ -307,6 +345,8 @@ final class CoreExpectation /** * Asserts that the absolute difference between the value and $expected * is lower than $delta. + * + * @return CoreExpectation */ public function toEqualWithDelta(mixed $expected, float $delta): CoreExpectation { @@ -319,6 +359,8 @@ final class CoreExpectation * Asserts that the value is one of the given values. * * @param iterable $values + * + * @return CoreExpectation */ public function toBeIn(iterable $values): CoreExpectation { @@ -329,6 +371,8 @@ final class CoreExpectation /** * Asserts that the value is infinite. + * + * @return CoreExpectation */ public function toBeInfinite(): CoreExpectation { @@ -341,6 +385,8 @@ final class CoreExpectation * Asserts that the value is an instance of $class. * * @param class-string $class + * + * @return CoreExpectation */ public function toBeInstanceOf(string $class): CoreExpectation { @@ -351,6 +397,8 @@ final class CoreExpectation /** * Asserts that the value is an array. + * + * @return CoreExpectation */ public function toBeArray(): CoreExpectation { @@ -361,6 +409,8 @@ final class CoreExpectation /** * Asserts that the value is of type bool. + * + * @return CoreExpectation */ public function toBeBool(): CoreExpectation { @@ -371,6 +421,8 @@ final class CoreExpectation /** * Asserts that the value is of type callable. + * + * @return CoreExpectation */ public function toBeCallable(): CoreExpectation { @@ -381,6 +433,8 @@ final class CoreExpectation /** * Asserts that the value is of type float. + * + * @return CoreExpectation */ public function toBeFloat(): CoreExpectation { @@ -391,6 +445,8 @@ final class CoreExpectation /** * Asserts that the value is of type int. + * + * @return CoreExpectation */ public function toBeInt(): CoreExpectation { @@ -401,6 +457,8 @@ final class CoreExpectation /** * Asserts that the value is of type iterable. + * + * @return CoreExpectation */ public function toBeIterable(): CoreExpectation { @@ -411,6 +469,8 @@ final class CoreExpectation /** * Asserts that the value is of type numeric. + * + * @return CoreExpectation */ public function toBeNumeric(): CoreExpectation { @@ -421,6 +481,8 @@ final class CoreExpectation /** * Asserts that the value is of type object. + * + * @return CoreExpectation */ public function toBeObject(): CoreExpectation { @@ -431,6 +493,8 @@ final class CoreExpectation /** * Asserts that the value is of type resource. + * + * @return CoreExpectation */ public function toBeResource(): CoreExpectation { @@ -441,6 +505,8 @@ final class CoreExpectation /** * Asserts that the value is of type scalar. + * + * @return CoreExpectation */ public function toBeScalar(): CoreExpectation { @@ -451,6 +517,8 @@ final class CoreExpectation /** * Asserts that the value is of type string. + * + * @return CoreExpectation */ public function toBeString(): CoreExpectation { @@ -461,6 +529,8 @@ final class CoreExpectation /** * Asserts that the value is a JSON string. + * + * @return CoreExpectation */ public function toBeJson(): CoreExpectation { @@ -474,6 +544,8 @@ final class CoreExpectation /** * Asserts that the value is NAN. + * + * @return CoreExpectation */ public function toBeNan(): CoreExpectation { @@ -484,6 +556,8 @@ final class CoreExpectation /** * Asserts that the value is null. + * + * @return CoreExpectation */ public function toBeNull(): CoreExpectation { @@ -494,6 +568,8 @@ final class CoreExpectation /** * Asserts that the value array has the provided $key. + * + * @return CoreExpectation */ public function toHaveKey(string|int $key, mixed $value = null): CoreExpectation { @@ -522,6 +598,8 @@ final class CoreExpectation * Asserts that the value array has the provided $keys. * * @param array $keys + * + * @return CoreExpectation */ public function toHaveKeys(array $keys): CoreExpectation { @@ -534,6 +612,8 @@ final class CoreExpectation /** * Asserts that the value is a directory. + * + * @return CoreExpectation */ public function toBeDirectory(): CoreExpectation { @@ -548,6 +628,8 @@ final class CoreExpectation /** * Asserts that the value is a directory and is readable. + * + * @return CoreExpectation */ public function toBeReadableDirectory(): CoreExpectation { @@ -562,6 +644,8 @@ final class CoreExpectation /** * Asserts that the value is a directory and is writable. + * + * @return CoreExpectation */ public function toBeWritableDirectory(): CoreExpectation { @@ -576,6 +660,8 @@ final class CoreExpectation /** * Asserts that the value is a file. + * + * @return CoreExpectation */ public function toBeFile(): CoreExpectation { @@ -590,6 +676,8 @@ final class CoreExpectation /** * Asserts that the value is a file and is readable. + * + * @return CoreExpectation */ public function toBeReadableFile(): CoreExpectation { @@ -604,6 +692,8 @@ final class CoreExpectation /** * Asserts that the value is a file and is writable. + * + * @return CoreExpectation */ public function toBeWritableFile(): CoreExpectation { @@ -619,6 +709,8 @@ final class CoreExpectation * Asserts that the value array matches the given array subset. * * @param iterable $array + * + * @return CoreExpectation */ public function toMatchArray(iterable|object $array): CoreExpectation { @@ -650,6 +742,8 @@ final class CoreExpectation * of the properties of an given object. * * @param iterable|object $object + * + * @return CoreExpectation */ public function toMatchObject(iterable|object $object): CoreExpectation { @@ -678,6 +772,8 @@ final class CoreExpectation /** * Asserts that the value matches a regular expression. + * + * @return CoreExpectation */ public function toMatch(string $expression): CoreExpectation { @@ -691,6 +787,8 @@ final class CoreExpectation /** * Asserts that the value matches a constraint. + * + * @return CoreExpectation */ public function toMatchConstraint(Constraint $constraint): CoreExpectation { @@ -703,6 +801,8 @@ final class CoreExpectation * Asserts that executing value throws an exception. * * @param (Closure(Throwable): mixed)|string $exception + * + * @return CoreExpectation */ public function toThrow(callable|string $exception, string $exceptionMessage = null): CoreExpectation {