GithubHelp home page GithubHelp logo

Comments (11)

webmozart avatar webmozart commented on July 17, 2024 1

@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.

beberlei avatar beberlei commented on July 17, 2024

ctype is locale dependent, all our code does not depend on environment right now.

from assert.

webmozart avatar webmozart commented on July 17, 2024

Really? Got to do some research then.

from assert.

beberlei avatar beberlei commented on July 17, 2024

@webmozart See http://php.net/manual/en/function.ctype-alnum.php its reference to "default locale" and the link to setlocale.

from assert.

mdavis1982 avatar mdavis1982 commented on July 17, 2024

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.

mdavis1982 avatar mdavis1982 commented on July 17, 2024

@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.

webmozart avatar webmozart commented on July 17, 2024

@mdavis1982 That's what I tried, but @beberlei said he didn't want to make breaking changes.

from assert.

beberlei avatar beberlei commented on July 17, 2024

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.

 avatar commented on July 17, 2024

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.

rquadling avatar rquadling commented on July 17, 2024

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.

rquadling avatar rquadling commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.