diff --git a/bin/MethodDocGenerator.php b/bin/MethodDocGenerator.php index 1e666458..c6b75946 100644 --- a/bin/MethodDocGenerator.php +++ b/bin/MethodDocGenerator.php @@ -20,6 +20,9 @@ */ class MethodDocGenerator { + /** + * @return void + */ public function generateChainDocs() { $phpFile = __DIR__.'/../lib/Assert/AssertionChain.php'; @@ -34,10 +37,10 @@ public function generateChainDocs() /** * @param ReflectionMethod[] $methods * @param string $format - * @param callable|false $skipParameterTest + * @param callable|bool $skipParameterTest * @param string $prefix * - * @return array + * @return string[] * * @throws AssertionFailedException */ @@ -47,6 +50,7 @@ private function generateMethodDocs($methods, $format, $skipParameterTest, $pref asort($methods); foreach ($methods as $method) { $doc = $method->getDocComment(); + assert($doc !== false); list(, $descriptionLine) = explode("\n", $doc); $shortDescription = trim(substr($descriptionLine, 7), '.'); $methodName = $prefix.($prefix ? ucfirst($method->getName()) : $method->getName()); @@ -132,11 +136,15 @@ function (ReflectionMethod $reflMethod) { * @param string $phpFile * @param string[] $lines * @param string $fileType + * + * @return void */ private function generateFile($phpFile, $lines, $fileType) { $phpFile = realpath($phpFile); + assert($phpFile !== false); $fileContent = file_get_contents($phpFile); + assert($fileContent !== false); switch ($fileType) { case 'class': @@ -162,6 +170,9 @@ private function generateFile($phpFile, $lines, $fileType) } } + /** + * @return void + */ public function generateAssertionDocs() { $phpFile = __DIR__.'/../lib/Assert/Assertion.php'; @@ -177,6 +188,9 @@ public function generateAssertionDocs() $this->generateFile($phpFile, $docs, 'class'); } + /** + * @return void + */ public function generateReadMe() { $mdFile = __DIR__.'/../README.md'; @@ -189,6 +203,9 @@ public function generateReadMe() $this->generateFile($mdFile, $docs, 'readme'); } + /** + * @return void + */ public function generateLazyAssertionDocs() { $phpFile = __DIR__.'/../lib/Assert/LazyAssertion.php'; diff --git a/composer.json b/composer.json index 21e27cb6..619b8e27 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "*", - "phpstan/phpstan-shim": "*", + "phpstan/phpstan": "*", "phpunit/phpunit": ">=6.0.0 <8" }, "autoload": { diff --git a/lib/Assert/Assert.php b/lib/Assert/Assert.php index 6910258d..3614b345 100644 --- a/lib/Assert/Assert.php +++ b/lib/Assert/Assert.php @@ -33,9 +33,6 @@ abstract class Assert * * @param mixed $value * @param string|callable|null $defaultMessage - * @param string|null $defaultPropertyPath - * - * @return AssertionChain * * @example * @@ -57,9 +54,6 @@ public static function that($value, $defaultMessage = null, string $defaultPrope * * @param mixed $values * @param string|callable|null $defaultMessage - * @param string|null $defaultPropertyPath - * - * @return AssertionChain */ public static function thatAll($values, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain { @@ -71,9 +65,6 @@ public static function thatAll($values, $defaultMessage = null, string $defaultP * * @param mixed $value * @param string|callable|null $defaultMessage - * @param string|null $defaultPropertyPath - * - * @return AssertionChain */ public static function thatNullOr($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain { @@ -82,8 +73,6 @@ public static function thatNullOr($value, $defaultMessage = null, string $defaul /** * Create a lazy assertion object. - * - * @return LazyAssertion */ public static function lazy(): LazyAssertion { diff --git a/lib/Assert/Assertion.php b/lib/Assert/Assertion.php index 6f5b3c2d..a443d83e 100644 --- a/lib/Assert/Assertion.php +++ b/lib/Assert/Assertion.php @@ -301,9 +301,6 @@ class Assertion * @param mixed $value * @param mixed $value2 * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -328,9 +325,6 @@ public static function eq($value, $value2, $message = null, string $propertyPath * @param mixed $value * @param mixed $value2 * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -351,9 +345,6 @@ public static function eqArraySubset($value, $value2, $message = null, string $p * @param mixed $value * @param mixed $value2 * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -378,9 +369,6 @@ public static function same($value, $value2, $message = null, string $propertyPa * @param mixed $value1 * @param mixed $value2 * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -404,9 +392,6 @@ public static function notEq($value1, $value2, $message = null, string $property * @param mixed $value1 * @param mixed $value2 * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -428,11 +413,7 @@ public static function notSame($value1, $value2, $message = null, string $proper * Assert that value is not in array of choices. * * @param mixed $value - * @param array $choices * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -455,9 +436,6 @@ public static function notInArray($value, array $choices, $message = null, strin * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -480,9 +458,6 @@ public static function integer($value, $message = null, string $propertyPath = n * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -505,9 +480,6 @@ public static function float($value, $message = null, string $propertyPath = nul * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -530,9 +502,6 @@ public static function digit($value, $message = null, string $propertyPath = nul * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -568,9 +537,6 @@ public static function integerish($value, $message = null, string $propertyPath * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -593,9 +559,6 @@ public static function boolean($value, $message = null, string $propertyPath = n * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -618,9 +581,6 @@ public static function scalar($value, $message = null, string $propertyPath = nu * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -643,9 +603,6 @@ public static function notEmpty($value, $message = null, string $propertyPath = * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -668,9 +625,6 @@ public static function noContent($value, $message = null, string $propertyPath = * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool */ public static function null($value, $message = null, string $propertyPath = null): bool { @@ -691,9 +645,6 @@ public static function null($value, $message = null, string $propertyPath = null * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -716,7 +667,6 @@ public static function notNull($value, $message = null, string $propertyPath = n * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath * * @return bool * @@ -743,9 +693,6 @@ public static function string($value, $message = null, string $propertyPath = nu * @param mixed $value * @param string $pattern * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -771,9 +718,6 @@ public static function regex($value, $pattern, $message = null, string $property * @param mixed $value * @param string $pattern * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -799,11 +743,8 @@ public static function notRegex($value, $pattern, $message = null, string $prope * @param mixed $value * @param int $length * @param string|callable|null $message - * @param string|null $propertyPath * @param string $encoding * - * @return bool - * * @throws AssertionFailedException */ public static function length($value, $length, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool @@ -830,11 +771,8 @@ public static function length($value, $length, $message = null, string $property * @param mixed $value * @param int $minLength * @param string|callable|null $message - * @param string|null $propertyPath * @param string $encoding * - * @return bool - * * @throws AssertionFailedException */ public static function minLength($value, $minLength, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool @@ -861,11 +799,8 @@ public static function minLength($value, $minLength, $message = null, string $pr * @param mixed $value * @param int $maxLength * @param string|callable|null $message - * @param string|null $propertyPath * @param string $encoding * - * @return bool - * * @throws AssertionFailedException */ public static function maxLength($value, $maxLength, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool @@ -893,11 +828,8 @@ public static function maxLength($value, $maxLength, $message = null, string $pr * @param int $minLength * @param int $maxLength * @param string|callable|null $message - * @param string|null $propertyPath * @param string $encoding * - * @return bool - * * @throws AssertionFailedException */ public static function betweenLength($value, $minLength, $maxLength, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool @@ -915,11 +847,8 @@ public static function betweenLength($value, $minLength, $maxLength, $message = * @param mixed $string * @param string $needle * @param string|callable|null $message - * @param string|null $propertyPath * @param string $encoding * - * @return bool - * * @throws AssertionFailedException */ public static function startsWith($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool @@ -945,11 +874,8 @@ public static function startsWith($string, $needle, $message = null, string $pro * @param mixed $string * @param string $needle * @param string|callable|null $message - * @param string|null $propertyPath * @param string $encoding * - * @return bool - * * @throws AssertionFailedException */ public static function endsWith($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool @@ -977,11 +903,8 @@ public static function endsWith($string, $needle, $message = null, string $prope * @param mixed $string * @param string $needle * @param string|callable|null $message - * @param string|null $propertyPath * @param string $encoding * - * @return bool - * * @throws AssertionFailedException */ public static function contains($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool @@ -1007,11 +930,8 @@ public static function contains($string, $needle, $message = null, string $prope * @param mixed $string * @param string $needle * @param string|callable|null $message - * @param string|null $propertyPath * @param string $encoding * - * @return bool - * * @throws AssertionFailedException */ public static function notContains($string, $needle, $message = null, string $propertyPath = null, $encoding = 'utf8'): bool @@ -1035,11 +955,7 @@ public static function notContains($string, $needle, $message = null, string $pr * Assert that value is in array of choices. * * @param mixed $value - * @param array $choices * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1064,11 +980,7 @@ public static function choice($value, array $choices, $message = null, string $p * This is an alias of {@see choice()}. * * @param mixed $value - * @param array $choices * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1082,9 +994,6 @@ public static function inArray($value, array $choices, $message = null, string $ * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1107,9 +1016,6 @@ public static function numeric($value, $message = null, string $propertyPath = n * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool */ public static function isResource($value, $message = null, string $propertyPath = null): bool { @@ -1130,9 +1036,6 @@ public static function isResource($value, $message = null, string $propertyPath * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1155,9 +1058,6 @@ public static function isArray($value, $message = null, string $propertyPath = n * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1180,9 +1080,6 @@ public static function isTraversable($value, $message = null, string $propertyPa * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1205,9 +1102,6 @@ public static function isArrayAccessible($value, $message = null, string $proper * * @param array|Countable|ResourceBundle|SimpleXMLElement $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1237,9 +1131,6 @@ public static function isCountable($value, $message = null, string $propertyPath * @param mixed $value * @param string|int $key * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1265,9 +1156,6 @@ public static function keyExists($value, $key, $message = null, string $property * @param mixed $value * @param string|int $key * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1293,9 +1181,6 @@ public static function keyNotExists($value, $key, $message = null, string $prope * @param mixed $value * @param string|int $key * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1321,9 +1206,6 @@ public static function keyIsset($value, $key, $message = null, string $propertyP * @param mixed $value * @param string|int $key * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1340,9 +1222,6 @@ public static function notEmptyKey($value, $key, $message = null, string $proper * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1366,9 +1245,6 @@ public static function notBlank($value, $message = null, string $propertyPath = * @param mixed $value * @param string $className * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1393,9 +1269,6 @@ public static function isInstanceOf($value, $className, $message = null, string * @param mixed $value * @param string $className * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1420,9 +1293,6 @@ public static function notIsInstanceOf($value, $className, $message = null, stri * @param mixed $value * @param string $className * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1448,9 +1318,6 @@ public static function subclassOf($value, $className, $message = null, string $p * @param mixed $minValue * @param mixed $maxValue * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1478,9 +1345,6 @@ public static function range($value, $minValue, $maxValue, $message = null, stri * @param mixed $value * @param mixed $minValue * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1507,9 +1371,6 @@ public static function min($value, $minValue, $message = null, string $propertyP * @param mixed $value * @param mixed $maxValue * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1535,9 +1396,6 @@ public static function max($value, $maxValue, $message = null, string $propertyP * * @param string $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1563,9 +1421,6 @@ public static function file($value, $message = null, string $propertyPath = null * * @param string $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1590,9 +1445,6 @@ public static function directory($value, $message = null, string $propertyPath = * * @param string $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1617,9 +1469,6 @@ public static function readable($value, $message = null, string $propertyPath = * * @param string $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1644,9 +1493,6 @@ public static function writeable($value, $message = null, string $propertyPath = * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1673,9 +1519,6 @@ public static function email($value, $message = null, string $propertyPath = nul * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException * @@ -1725,9 +1568,6 @@ public static function url($value, $message = null, string $propertyPath = null) * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1752,9 +1592,6 @@ public static function alnum($value, $message = null, string $propertyPath = nul * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1777,9 +1614,6 @@ public static function true($value, $message = null, string $propertyPath = null * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1802,9 +1636,6 @@ public static function false($value, $message = null, string $propertyPath = nul * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1827,9 +1658,6 @@ public static function classExists($value, $message = null, string $propertyPath * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1853,9 +1681,6 @@ public static function interfaceExists($value, $message = null, string $property * @param mixed $class * @param string $interfaceName * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1894,9 +1719,6 @@ public static function implementsInterface($class, $interfaceName, $message = nu * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1921,9 +1743,6 @@ public static function isJsonString($value, $message = null, string $propertyPat * * @param string $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1954,9 +1773,6 @@ public static function uuid($value, $message = null, string $propertyPath = null * * @param string $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -1980,9 +1796,6 @@ public static function e164($value, $message = null, string $propertyPath = null * @param array|Countable|ResourceBundle|SimpleXMLElement $countable * @param int $count * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2007,9 +1820,6 @@ public static function count($countable, $count, $message = null, string $proper * @param array|Countable|ResourceBundle|SimpleXMLElement $countable * @param int $count * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2034,9 +1844,6 @@ public static function minCount($countable, $count, $message = null, string $pro * @param array|Countable|ResourceBundle|SimpleXMLElement $countable * @param int $count * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2107,12 +1914,7 @@ public static function __callStatic($method, $args) /** * Determines if the values array has every choice as key and that this choice has content. * - * @param array $values - * @param array $choices * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2133,9 +1935,6 @@ public static function choicesNotEmpty(array $values, array $choices, $message = * @param string $value * @param mixed $object * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2160,9 +1959,6 @@ public static function methodExists($value, $object, $message = null, string $pr * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2186,9 +1982,6 @@ public static function isObject($value, $message = null, string $propertyPath = * @param mixed $value * @param mixed $limit * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2213,9 +2006,6 @@ public static function lessThan($value, $limit, $message = null, string $propert * @param mixed $value * @param mixed $limit * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2240,9 +2030,6 @@ public static function lessOrEqualThan($value, $limit, $message = null, string $ * @param mixed $value * @param mixed $limit * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2267,9 +2054,6 @@ public static function greaterThan($value, $limit, $message = null, string $prop * @param mixed $value * @param mixed $limit * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2297,8 +2081,6 @@ public static function greaterOrEqualThan($value, $limit, $message = null, strin * @param string|callable|null $message * @param string $propertyPath * - * @return bool - * * @throws AssertionFailedException */ public static function between($value, $lowerLimit, $upperLimit, $message = null, string $propertyPath = null): bool @@ -2326,8 +2108,6 @@ public static function between($value, $lowerLimit, $upperLimit, $message = null * @param string|callable|null $message * @param string $propertyPath * - * @return bool - * * @throws AssertionFailedException */ public static function betweenExclusive($value, $lowerLimit, $upperLimit, $message = null, string $propertyPath = null): bool @@ -2351,9 +2131,6 @@ public static function betweenExclusive($value, $lowerLimit, $upperLimit, $messa * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2378,9 +2155,6 @@ public static function extensionLoaded($value, $message = null, string $property * @param string $format supports all of the options date(), except for the following: * N, w, W, t, L, o, B, a, A, g, h, I, O, P, Z, c, r * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException * @@ -2411,9 +2185,6 @@ public static function date($value, $format, $message = null, string $propertyPa * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2432,9 +2203,6 @@ public static function objectOrClass($value, $message = null, string $propertyPa * @param mixed $value * @param string $property * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2459,11 +2227,7 @@ public static function propertyExists($value, $property, $message = null, string * Assert that the value is an object or class, and that the properties all exist. * * @param mixed $value - * @param array $properties * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2499,9 +2263,6 @@ public static function propertiesExist($value, array $properties, $message = nul * @param string $operator * @param string $version2 * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2529,9 +2290,6 @@ public static function version($version1, $operator, $version2, $message = null, * @param string $operator * @param mixed $version * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2549,9 +2307,6 @@ public static function phpVersion($operator, $version, $message = null, string $ * @param string $operator * @param mixed $version * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2567,9 +2322,6 @@ public static function extensionVersion($extension, $operator, $version, $messag * * @param mixed $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2595,9 +2347,6 @@ public static function isCallable($value, $message = null, string $propertyPath * @param mixed $value * @param callable $callback * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2624,9 +2373,6 @@ public static function satisfy($value, $callback, $message = null, string $prope * @param string $value * @param int|null $flag * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException * @@ -2653,9 +2399,6 @@ public static function ip($value, $flag = null, $message = null, string $propert * @param string $value * @param int|null $flag * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException * @@ -2675,9 +2418,6 @@ public static function ipv4($value, $flag = null, $message = null, string $prope * @param string $value * @param int|null $flag * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException * @@ -2695,9 +2435,6 @@ public static function ipv6($value, $flag = null, $message = null, string $prope * * @param mixed $constant * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool */ public static function defined($constant, $message = null, string $propertyPath = null): bool { @@ -2715,9 +2452,6 @@ public static function defined($constant, $message = null, string $propertyPath * * @param string $value * @param string|callable|null $message - * @param string|null $propertyPath - * - * @return bool * * @throws AssertionFailedException */ @@ -2740,8 +2474,6 @@ public static function base64($value, $message = null, string $propertyPath = nu * @param mixed $value * @param string|callable|null $message * @param int $code - * @param string|null $propertyPath - * @param array $constraints * * @return mixed */ @@ -2756,8 +2488,6 @@ protected static function createException($value, $message, $code, string $prope * Make a string version of a value. * * @param mixed $value - * - * @return string */ protected static function stringify($value): string { @@ -2790,8 +2520,6 @@ protected static function stringify($value): string * Generate the message. * * @param string|callable|null $message - * - * @return string */ protected static function generateMessage($message): string { diff --git a/lib/Assert/AssertionChain.php b/lib/Assert/AssertionChain.php index dbb6e839..018bd965 100644 --- a/lib/Assert/AssertionChain.php +++ b/lib/Assert/AssertionChain.php @@ -150,7 +150,6 @@ class AssertionChain * * @param mixed $value * @param string|callable|null $defaultMessage - * @param string|null $defaultPropertyPath */ public function __construct($value, $defaultMessage = null, string $defaultPropertyPath = null) { @@ -164,8 +163,6 @@ public function __construct($value, $defaultMessage = null, string $defaultPrope * * @param string $methodName * @param array $args - * - * @return AssertionChain */ public function __call($methodName, $args): AssertionChain { @@ -208,8 +205,6 @@ public function __call($methodName, $args): AssertionChain /** * Switch chain into validation mode for an array of values. - * - * @return AssertionChain */ public function all(): AssertionChain { @@ -220,8 +215,6 @@ public function all(): AssertionChain /** * Switch chain into mode allowing nulls, ignoring further assertions. - * - * @return AssertionChain */ public function nullOr(): AssertionChain { diff --git a/lib/Assert/AssertionFailedException.php b/lib/Assert/AssertionFailedException.php index c1848388..7e0b2ec3 100644 --- a/lib/Assert/AssertionFailedException.php +++ b/lib/Assert/AssertionFailedException.php @@ -28,8 +28,5 @@ public function getPropertyPath(); */ public function getValue(); - /** - * @return array - */ public function getConstraints(): array; } diff --git a/lib/Assert/InvalidArgumentException.php b/lib/Assert/InvalidArgumentException.php index acd96654..9516e077 100644 --- a/lib/Assert/InvalidArgumentException.php +++ b/lib/Assert/InvalidArgumentException.php @@ -66,8 +66,6 @@ public function getValue() /** * Get the constraints that applied to the failed assertion. - * - * @return array */ public function getConstraints(): array { diff --git a/lib/Assert/LazyAssertion.php b/lib/Assert/LazyAssertion.php index 9301c6b4..ea16bbce 100644 --- a/lib/Assert/LazyAssertion.php +++ b/lib/Assert/LazyAssertion.php @@ -128,7 +128,6 @@ class LazyAssertion /** * @param mixed $value - * @param string|null $propertyPath * @param string|callable|null $defaultMessage * * @return $this @@ -177,8 +176,6 @@ public function __call($method, $args) } /** - * @return bool - * * @throws LazyAssertionException */ public function verifyNow(): bool @@ -191,8 +188,6 @@ public function verifyNow(): bool } /** - * @param string $className - * * @return $this */ public function setAssertClass(string $className): LazyAssertion @@ -207,8 +202,6 @@ public function setAssertClass(string $className): LazyAssertion } /** - * @param string $className - * * @return $this */ public function setExceptionClass(string $className): LazyAssertion diff --git a/lib/Assert/LazyAssertionException.php b/lib/Assert/LazyAssertionException.php index f76ecc69..2ba59dd7 100644 --- a/lib/Assert/LazyAssertionException.php +++ b/lib/Assert/LazyAssertionException.php @@ -23,8 +23,6 @@ class LazyAssertionException extends InvalidArgumentException /** * @param InvalidArgumentException[] $errors - * - * @return self */ public static function fromErrors(array $errors): self { diff --git a/lib/Assert/functions.php b/lib/Assert/functions.php index e0ccbd7d..1a4e84d9 100644 --- a/lib/Assert/functions.php +++ b/lib/Assert/functions.php @@ -24,8 +24,6 @@ * @param string|callable|null $defaultMessage * @param string $defaultPropertyPath * - * @return AssertionChain - * * @example * * \Assert\that($value)->notEmpty()->integer(); @@ -45,8 +43,6 @@ function that($value, $defaultMessage = null, string $defaultPropertyPath = null * @param mixed $values * @param string|callable|null $defaultMessage * @param string $defaultPropertyPath - * - * @return AssertionChain */ function thatAll($values, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain { @@ -60,8 +56,6 @@ function thatAll($values, $defaultMessage = null, string $defaultPropertyPath = * @param string|callable|null $defaultMessage * @param string $defaultPropertyPath * - * @return AssertionChain - * * @deprecated In favour of Assert::thatNullOr($value, $defaultMessage = null, $defaultPropertyPath = null) */ function thatNullOr($value, $defaultMessage = null, string $defaultPropertyPath = null): AssertionChain @@ -71,8 +65,6 @@ function thatNullOr($value, $defaultMessage = null, string $defaultPropertyPath /** * Create a lazy assertion object. - * - * @return LazyAssertion */ function lazy(): LazyAssertion { diff --git a/tests/Assert/Tests/AssertionFailedExceptionTest.php b/tests/Assert/Tests/AssertionFailedExceptionTest.php index c5d9c25e..6c650b95 100644 --- a/tests/Assert/Tests/AssertionFailedExceptionTest.php +++ b/tests/Assert/Tests/AssertionFailedExceptionTest.php @@ -25,8 +25,6 @@ class AssertionFailedExceptionTest extends TestCase { /** - * @param string $exceptionClass - * * @dataProvider provideExceptionClasses */ public function testFailedExceptionIsAValidThrowable(string $exceptionClass)