utils
utils copied to clipboard
Feature Request: matching method from nette/tester
I find my self very useful nette/tester (Assert::matching and Assert::isMatching).
https://github.com/nette/tester/blob/55057023d08aa2e3018c21a8c40ea2b60c5ae80f/src/Framework/Assert.php#L525
Would you consider to add this kind of method to nette/utils? I can handle PR.
I know there is already Strings::match method, but I like predefined patterns.
https://github.com/nette/tester/blob/55057023d08aa2e3018c21a8c40ea2b60c5ae80f/src/Framework/Assert.php#L437-L454
WDYT?
Btw. I'll refactor Tester to match() & matchRe() or similar.
So no more isMatching('Hello %a%', 'Hello world?')?
No. Only split pattern matching and regexp matching to be API more clear.
I see. Anyway, it will be part of the nette/tester API. Does it make sense introduce something like that in nette/utils?
Matching is (surprisingly) quite a complex matter. Maybe it is a topic for a separate package.
Matching in Tester I don't find so ingenious, because I'm still unable to remember what each %?% means…