Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request validation rules documentation based on static analysis instead of eval #237

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

romalytvynenko
Copy link
Member

@romalytvynenko romalytvynenko commented Sep 26, 2023

WIP

fixes #226, fixes #169, fixes #235

This one is another very complex PR, but it would allow creating playgrounds for Scramble by making rules evaluation optional and relying on static analysis instead will reduce the amount of bugs due to evaluation issues.

To make this possible a bit more features to inference system must be added:

  • Static methods call analysis support
  • Late static binding analysis support (proper handing of static::, self::, __CLASS__)
    • Figure out general approach
    • class const fetching
    • Consts fetching
    • new calls
    • Method calls (static, non-static)
    • Props fetching
  • Consts fetch type inference support
  • Static method calls extensions support
  • Add array_keys function support
  • Inferring type from array value
  • Inferring type from object value

And to Scramble docs generation:

  • Rule::* methods inference support (via extensions for now)
  • Rules classes better support
    • Database rules (exists, unique) and their methods
    • new Enum|In|* rule creation
  • New Rules API
  • Documenting statically analyzed rules (rules type)
  • Runtime objects -> Types conversion (for class-based rules)

@romalytvynenko romalytvynenko force-pushed the 226-docs-generation-fails-for-requests-that-utilise-custom-values branch from a1541cf to 75bad2d Compare September 27, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant