BaseRules class abstract

Framework\Validation\BaseRules

Class BaseRules.

Implements: Stringable

Defined in libraries/validation/src/BaseRules.php

Properties #

$rules
-

$rules

protected array $rules = array ( )

Methods #

__construct()
-
__get()
-
__toString()
-
blank()
If the field has a blank string, the validation passes.
create()
-
empty()
If the field has an empty value, the validation passes.
null()
If the field value is null, the validation passes.
optional()
Set field as optional.
esc()
-
implode()
-

__construct()

public final function __construct()

__get()

public function __get(string $property): mixed
Parameters
  • string $property
Returns mixed

__toString()

public function __toString(): string
Returns string

blank()

public function blank(): static

If the field has a blank string, the validation passes.

Returns static

create()

public static function create(): static
Returns static

empty()

public function empty(): static

If the field has an empty value, the validation passes.

Returns static

null()

public function null(): static

If the field value is null, the validation passes.

Returns static

optional()

public function optional(): static

Set field as optional.

If field is undefined, validation passes.

Returns static

esc()

protected function esc(string $value): string
Parameters
  • string $value
Returns string

implode()

protected function implode(array $values): string
Parameters
  • array $values
Returns string