-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add assertions for not matching regexes #261
Conversation
lib/Assert/Assertion.php
Outdated
|
||
if (\preg_match($pattern, $value)) { | ||
$message = \sprintf( | ||
static::generateMessage($message ?: 'Value "%s" does match expression.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'does match' => 'matches'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
lib/Assert/Assertion.php
Outdated
|
||
if (!\file_exists($value)) { | ||
$message = \sprintf( | ||
static::generateMessage($message ?: 'Path "%s" was expected to be exsting.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert::file() covers this assertion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertion and test removed
README.md
Outdated
@@ -204,6 +204,7 @@ Assertion::extensionLoaded(mixed $value); | |||
Assertion::extensionVersion(string $extension, string $operator, mixed $version); | |||
Assertion::false(mixed $value); | |||
Assertion::file(string $value); | |||
Assertion::fileExists(string $value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebuild the documentation please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thank you. |
* 'master' of github.com:beberlei/assert: add assertions for existing files and not matching regexes (#261) # Conflicts: # lib/Assert/Assertion.php
I would like to add two new assertions I want to use.