Giter Site home page Giter Site logo

Comments (16)

norberttech avatar norberttech commented on August 25, 2024

I think it would solve some problems and we definitely should add something like that. But I think it could be done using pattern expanders, more like

[
  @[email protected]({
    "id": @integer@,
    "name": "@[email protected](\"Posiłek \")",
    "date": @string@
  }).repeatTimes(10)
]

from php-matcher.

piotrjura avatar piotrjura commented on August 25, 2024

If I'll have time I'll try to implement it, but from I saw in the code I would need some help with this. Any docs on writing new features for the lib would generally be very useful.

from php-matcher.

norberttech avatar norberttech commented on August 25, 2024

If u are interested u could start with #34 its much simpler and you can contact me for any help.

from php-matcher.

piotrjura avatar piotrjura commented on August 25, 2024

#36

from php-matcher.

piotrjura avatar piotrjura commented on August 25, 2024

I could try and implement multiple elements matching, if the example above is how would you see it. Looks fine for me.

from php-matcher.

norberttech avatar norberttech commented on August 25, 2024

I think you could start with repeatTimes($number) expander. It should be generic. About this @json_object@ I'm not sure yet. Need to think about this but if you have any other propositions feel free to share them.
ping @defrag

from php-matcher.

piotrjura avatar piotrjura commented on August 25, 2024
[
  @[email protected]({
    "id": @integer@,
    "name": "@[email protected](\"Posiłek \")",
    "date": @string@
  }).repeatTimes(10)
]

Would something like that work? I mean does expanders support nested patterns out of the box (@string@ inside contains etc.)? And should .repeatTimes() work only with strings? As integers and doubles probably could not make any sensible use of repeatTimes, I guess. Is there a way to limit where expanders could be attached? What you think?

from php-matcher.

defrag avatar defrag commented on August 25, 2024

@[email protected]({}) doesnt make too much sense, since you implicitly assume that the string is json string. Idea is pretty good tho, but perhaps something more like:

@[email protected]({
  "id" : @integer@ 
}).repeatTimes(10)

from php-matcher.

norberttech avatar norberttech commented on August 25, 2024

hmm this match expander sounds interesting.

from php-matcher.

piotrjura avatar piotrjura commented on August 25, 2024

@defrag looks really neat

from php-matcher.

javierseixas avatar javierseixas commented on August 25, 2024

+1
It would be really useful!!

What is the state of this feature? It's being developed?

from php-matcher.

gitis avatar gitis commented on August 25, 2024

+1

from php-matcher.

eimantaspu avatar eimantaspu commented on August 25, 2024

+1

from php-matcher.

ZilKil avatar ZilKil commented on August 25, 2024

+1

from php-matcher.

tomaspocevicius avatar tomaspocevicius commented on August 25, 2024

+1

from php-matcher.

norberttech avatar norberttech commented on August 25, 2024

@gitis @Sorpion @ZilKil @tompoc I think we all agree that this feature would be extremely useful, any of you is more than welcome to create a pull request. Unfortunately I simply don't have time to do it on my own, but don't hesitate to ask for any help you need.

from php-matcher.

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.