mirror of
https://codeberg.org/reflect/reflect-rules-plugin.git
synced 2025-09-14 08:53:42 +02:00
feat: add Ruleset->GET() and Ruleset->POST() return Ruleset instance for method chaining
This commit is contained in:
parent
df150f0d86
commit
40ea9f510c
1 changed files with 6 additions and 2 deletions
|
@ -122,7 +122,7 @@
|
||||||
// ----
|
// ----
|
||||||
|
|
||||||
// Perform request processing on GET properties (search parameters)
|
// Perform request processing on GET properties (search parameters)
|
||||||
public function GET(array $rules): void {
|
public function GET(array $rules): self {
|
||||||
// (Re)enable strict mode if property is null
|
// (Re)enable strict mode if property is null
|
||||||
if ($this->strict === null) {
|
if ($this->strict === null) {
|
||||||
$this->strict = true;
|
$this->strict = true;
|
||||||
|
@ -133,10 +133,12 @@
|
||||||
|
|
||||||
$this->eval_rules($rule, Scope::GET);
|
$this->eval_rules($rule, Scope::GET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform request processing on POST properties (request body)
|
// Perform request processing on POST properties (request body)
|
||||||
public function POST(array $rules): void {
|
public function POST(array $rules): self {
|
||||||
// (Re)enable strict mode if property is null
|
// (Re)enable strict mode if property is null
|
||||||
if ($this->strict === null) {
|
if ($this->strict === null) {
|
||||||
$this->strict = true;
|
$this->strict = true;
|
||||||
|
@ -147,6 +149,8 @@
|
||||||
|
|
||||||
$this->eval_rules($rule, Scope::POST);
|
$this->eval_rules($rule, Scope::POST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----
|
// ----
|
||||||
|
|
Loading…
Add table
Reference in a new issue