Commit graph

19 commits

Author SHA1 Message Date
aa7d969350 feat: add return Ruleset instance to Ruleset->GET() and Ruleset->POST() (#17)
Quick PR that adds return values to `Ruleset->GET()` and `Ruleset->POST()` to allow for method chaining with for example `Ruleset->validate_or_exit()`. This can come handy for streamlining simple rulesets.

# Example
```php
$ruleset->GET(new Rules("something")->type(Type::STRING))->validate_or_exit();
```

Reviewed-on: https://codeberg.org/reflect/reflect-rules-plugin/pulls/17
2024-11-28 17:05:16 +00:00
vlw
df150f0d86 feat: add method to validate and return Reflect\Response if Ruleset is invalid to the Ruleset class (#16)
Closes #13

Reviewed-on: https://codeberg.org/reflect/reflect-rules-plugin/pulls/16
Co-authored-by: vlw <victor@vlw.se>
Co-committed-by: vlw <victor@vlw.se>
2024-11-20 10:39:33 +00:00
vlw
4133b25e93 docs(chore): change link to Reflect in README from GitHub to Codeberg (#15)
Reviewed-on: https://codeberg.org/reflect/reflect-rules-plugin/pulls/15
Co-authored-by: vlw <victor@vlw.se>
Co-committed-by: vlw <victor@vlw.se>
2024-11-20 10:39:03 +00:00
vlw
24352ae45b doc(fix): use a POST request as the example in the README instread of GET (#14)
The example sends a request body to a GET request, and [GET requests can not have a request body](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET). So this PR changes the example to a POST request instead.

Reviewed-on: https://codeberg.org/reflect/reflect-rules-plugin/pulls/14
Co-authored-by: vlw <victor@vlw.se>
Co-committed-by: vlw <victor@vlw.se>
2024-11-20 10:38:06 +00:00
9c837fd194
feat: add strict mode (#11)
* feat: add strict mode

* feat(doc): add strict mode to README
2024-01-17 12:07:44 +01:00
81a2b2129c
fix: typehint for eval_array with POST data (#12) 2024-01-17 12:03:11 +01:00
5ea11cadf1
feat: use CSV for Type::ARRAY in GET Rules (#10)
* fix: eval method for Type::ARRAY and Type::OBJECT

* fix: use CSV for GET array

* feat(doc): add CSV ref. to README
2024-01-06 14:24:16 +01:00
3e380c0957
feat: evaluate whole Rulesets and set errors from Error enum (#9)
* wip: 2023-12-26T14:36:46+0100 (1703597806)

* feat: eval whole ruleset and return error enum name

* fix: remove unused package

* wip: 2023-12-26T14:36:46+0100 (1703597806)

* feat(doc): add new ruleset logic to README
2023-12-31 14:51:38 +01:00
067896dafe
feat: add Type::ENUM (#8)
* feat: add multiple Types support

* feat: add Type::ENUM as type constraint

* feat(doc): add Type::ENUM to README

* fix(doc): Type::ENUM anchor link fix

* fix: bool true bug
2023-11-29 09:24:17 +01:00
23530c57b0
feat: add support for multiple Type rules (#7)
* feat: add multiple Types support

* feat(doc): add type union to README
2023-11-29 09:08:23 +01:00
c70a46568e
feat: add default() rule for undefiend properties in scope (#6)
* feat: add default() rule

* feat(doc): add default() to README
2023-11-29 06:54:32 +01:00
6583f87866
fix: pass scope for all eval methods (#4) 2023-11-20 15:15:34 +01:00
7fc27ff89c
feat: coerce primitive boolean from strings for GET rules (#3)
* feat: coerce bool primitive from strings

* fix(doc): GitHub md highliting
2023-11-20 15:05:52 +01:00
d14d4bca6a
fix: explicit xEnum minimum-stability (#1) 2023-11-20 11:31:26 +01:00
88c6177b8f fix: explicit xEnum minimum-stability 2023-11-20 11:27:26 +01:00
ba9afb3ebb
feat(doc): add LICENSE 2023-11-17 13:26:27 +01:00
1a8f4dcfd1 fix(doc): doc links 2023-11-17 13:23:25 +01:00
9c0e8d4d6a feat(doc): add README 2023-11-17 13:19:19 +01:00
efc908b31b initial commit 2023-11-17 12:21:13 +01:00