Support the new methods in 1.4
I released 1.4.0 with some new assertions that should be added here.
- Assert::ip()
- Assert::ipv4()
- Assert::ipv6()
- Assert::notRegex()
- Assert::interfaceExists()
- Assert::isList()
- Assert::isMap()
@Nyholm I'm planning to work on it the next week cc/ @ondrejmirtes
Maybe good to change the title to Support the new methods between 1.4 and 1.7
https://github.com/webmozart/assert/blob/1.7.0/CHANGELOG.md#170-2020-02-14
fyi @ondrejmirtes I went through methods in webmozart/assert and what we support here and saw that only the following don't further specify types:
type:
- Assert::uniqueValues() (in https://github.com/phpstan/phpstan-webmozart-assert/pull/178 we learned that we can't narrow array further unfortunately..)
string:
- Assert::notContains()
- Assert::notStartsWith()
- Assert::notEndsWith()
- Assert::regex()
- Assert::notRegex()
file:
- Assert::fileExists()
- Assert::file()
- Assert::directory()
- Assert::readable()
- Assert::writable()
object:
- Assert::propertyNotExists()
- Assert::methodNotExists()
function:
- Assert::throws()
I'm not sure if more is possible. Related to this issue the only one left is notRegex(), which checks that a string does not match a given regex. Not sure, but I don't think we can specify further types here, except doing something with constant strings maybe, but not sure if it's possible/worth.
IMO this issue can be closed, what do you think?