Comments (11)
@mdavis1982 as far as I see, the problem is that this would break backwards compatibility of the library. You can find a very similar library where this and some other small issues are fixed here though: https://github.com/webmozart/assert
from assert.
ctype is locale dependent, all our code does not depend on environment right now.
from assert.
Really? Got to do some research then.
from assert.
@webmozart See http://php.net/manual/en/function.ctype-alnum.php its reference to "default locale" and the link to setlocale
.
from assert.
I agree with @webmozart that this is confusing. I would expect that an alphanumeric check would mean that something like 123abc
would also pass because the content of it is alphanumeric.
Maybe the check that it starts with a letter could be removed @beberlei?
from assert.
@webmozart Of course. This could be fixed and tagged as a different version though? I'd like to contribute to the library to fix issues such as these (I'm going through all of the issues now). Do you think you could possibly contribute some of your other assertions to this library?
from assert.
@mdavis1982 That's what I tried, but @beberlei said he didn't want to make breaking changes.
from assert.
its not really a breaking change, because we are making the validation less strict. Making it stricter would be a problem though. I consider this a bug, if alnum actually means starting with 123 is allwoed as well.
from assert.
Hi,
I'd like to draw your attention to this issue again since we're using the library a lot in our applications and find the nuance problematic when using alnum check from time to time. It says that "123" is not alphanumeric which, of course, is not true and is simply a bug. This forces us to write unnecessary regexes or manually use ctype_alnum
Any plans on fixing it soon?
from assert.
Hi. I'm happy to accept PRs on this. I'm sort of the de-facto maintainer now, but the library is still @beberlei's.
As for BCs, I'm using semantic versioning (and nearly fully understanding it!!! Yay! Please excuse the hiccough in the V3.2 version .. should all be sorted now!), so a v4 and a clear differentiation would be nice, but things would really need to be tested as we don't all work in all environments.
from assert.
Also, as you are able to subclass the Assert library now, you may find it "simpler" to implement your own assertions on top of Assert.
from assert.
Related Issues (20)
- Invalidly required array instead of iterable HOT 3
- date does not work with variable precision of microseconds HOT 1
- Assertion::url() does not support url with underscores in subdomains HOT 1
- Assertion::keySet
- issues with NAN HOT 3
- Assert\Assertion in annotations HOT 1
- PHP 8.0 compatibility HOT 2
- Invalid psalm annotation
- [BC break] Changes introduced in v3.2.4-v3.2.7 are excluded in v3.3.0 HOT 1
- Assertion::url validates invalid domain names HOT 1
- PHP 8 vs is_resource() HOT 1
- method greaterThan really checks greaterOrEqualThan
- `Assertion::uuid` assertion generates fatal error
- Allow predicated validation in Lazy Assertions chains
- assert/CONTRIBUTING.md on `master`
- Is there a way to assert for known specific values? HOT 1
- API to improve describing property paths
- Support to return false when an assertion fails HOT 1
- How about an assertion for array shapes?
- Assertion:date fails when matching February 29th without date
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assert.