Skip to content

Documentation issue IN Rule #104

Open

Description

@MaxXxaM

This code bellow from documentation don't work:

$validation = $validator->validate($data, [
    'enabled' => [
        'required', 
        $validator('in', [true, 1])->strict()
    ]
]);

Because strict() method return void

Edit documentation like this:

/** @var In $boolValidator */
$boolValidator = $validator('in', [true, 1]);
$boolValidator->strict();

$validation = $validator->validate($data, [
    'enabled' => [ 'required', $boolValidator]
]);

Or replace returned type by Validator.

Activity

  1. changed the title [-]Documentation issue[/-] on Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions