From d4a1be8fd5a09061ebf943963f558c6441d09bc9 Mon Sep 17 00:00:00 2001 From: Philipp Scheit Date: Wed, 25 Jun 2025 21:24:15 +0200 Subject: [PATCH] Fix HasToString description according to the Java equivalent --- hamcrest/Hamcrest.php | 3 ++- hamcrest/Hamcrest/Core/HasToString.php | 5 +++-- hamcrest/Hamcrest/Matchers.php | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hamcrest/Hamcrest.php b/hamcrest/Hamcrest.php index 55a2dd8c5..a521de8a4 100644 --- a/hamcrest/Hamcrest.php +++ b/hamcrest/Hamcrest.php @@ -313,7 +313,8 @@ function everyItem(\Hamcrest\Matcher $itemMatcher) if (!function_exists('hasToString')) { /** - * Does array size satisfy a given matcher? + * Creates a matcher that matches any examined object whose toString or + * __toString() method returns a value equalTo the specified string. */ function hasToString($matcher) { diff --git a/hamcrest/Hamcrest/Core/HasToString.php b/hamcrest/Hamcrest/Core/HasToString.php index 45bd9102e..c2e4801ba 100644 --- a/hamcrest/Hamcrest/Core/HasToString.php +++ b/hamcrest/Hamcrest/Core/HasToString.php @@ -10,7 +10,7 @@ use Hamcrest\Util; /** - * Matches if array size satisfies a nested matcher. + * A Matcher that checks the output of the toString() or __toString() method. */ class HasToString extends FeatureMatcher { @@ -45,7 +45,8 @@ protected function featureValueOf($actual) } /** - * Does array size satisfy a given matcher? + * Creates a matcher that matches any examined object whose toString or + * __toString() method returns a value equalTo the specified string. * * @factory */ diff --git a/hamcrest/Hamcrest/Matchers.php b/hamcrest/Hamcrest/Matchers.php index 23232e450..719d2f9e5 100644 --- a/hamcrest/Hamcrest/Matchers.php +++ b/hamcrest/Hamcrest/Matchers.php @@ -248,7 +248,8 @@ public static function everyItem(\Hamcrest\Matcher $itemMatcher) } /** - * Does array size satisfy a given matcher? + * Creates a matcher that matches any examined object whose toString or + * __toString() method returns a value equalTo the specified string. */ public static function hasToString($matcher) {