summaryrefslogtreecommitdiff
path: root/vendor/beberlei/assert/lib/Assert/Assert.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/beberlei/assert/lib/Assert/Assert.php')
-rw-r--r--vendor/beberlei/assert/lib/Assert/Assert.php36
1 files changed, 12 insertions, 24 deletions
diff --git a/vendor/beberlei/assert/lib/Assert/Assert.php b/vendor/beberlei/assert/lib/Assert/Assert.php
index 39bd9d64d..3614b3455 100644
--- a/vendor/beberlei/assert/lib/Assert/Assert.php
+++ b/vendor/beberlei/assert/lib/Assert/Assert.php
@@ -31,6 +31,9 @@ abstract class Assert
* The invocation of this method starts an assertion chain
* that is happening on the passed value.
*
+ * @param mixed $value
+ * @param string|callable|null $defaultMessage
+ *
* @example
*
* Assert::that($value)->notEmpty()->integer();
@@ -38,14 +41,8 @@ abstract class Assert
*
* The assertion chain can be stateful, that means be careful when you reuse
* it. You should never pass around the chain.
- *
- * @param mixed $value
- * @param string $defaultMessage
- * @param string $defaultPropertyPath
- *
- * @return \Assert\AssertionChain
*/
- public static function that($value, $defaultMessage = null, $defaultPropertyPath = null)
+ public static function that($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain
{
$assertionChain = new AssertionChain($value, $defaultMessage, $defaultPropertyPath);
@@ -55,13 +52,10 @@ abstract class Assert
/**
* Start validation on a set of values, returns {@link AssertionChain}.
*
- * @param mixed $values
- * @param string $defaultMessage
- * @param string $defaultPropertyPath
- *
- * @return \Assert\AssertionChain
+ * @param mixed $values
+ * @param string|callable|null $defaultMessage
*/
- public static function thatAll($values, $defaultMessage = null, $defaultPropertyPath = null)
+ public static function thatAll($values, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain
{
return static::that($values, $defaultMessage, $defaultPropertyPath)->all();
}
@@ -69,29 +63,23 @@ abstract class Assert
/**
* Start validation and allow NULL, returns {@link AssertionChain}.
*
- * @param mixed $value
- * @param string $defaultMessage
- * @param string $defaultPropertyPath
- *
- * @return \Assert\AssertionChain
+ * @param mixed $value
+ * @param string|callable|null $defaultMessage
*/
- public static function thatNullOr($value, $defaultMessage = null, $defaultPropertyPath = null)
+ public static function thatNullOr($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain
{
return static::that($value, $defaultMessage, $defaultPropertyPath)->nullOr();
}
/**
* Create a lazy assertion object.
- *
- * @return \Assert\LazyAssertion
*/
- public static function lazy()
+ public static function lazy(): LazyAssertion
{
$lazyAssertion = new LazyAssertion();
return $lazyAssertion
->setAssertClass(\get_called_class())
- ->setExceptionClass(static::$lazyAssertionExceptionClass)
- ;
+ ->setExceptionClass(static::$lazyAssertionExceptionClass);
}
}