protected function compileIn($key, $masque)
    {
        if (!preg_match("/^in:(.+)$/", $masque, $match)) {
            return;
        }

        $values = explode(",", end($match));

        foreach ($values as $index => $value) {
            $values[$index] = trim($value);
        }

        if (in_array($this->inputs[$key], $values)) {
            return;
        }

        $this->last_message = $this->lexique('in', [
            'attribute' => $key,
            'value' => implode(", ", $values)
        ]);

        $this->fails = true;

        $this->errors[$key][] = [
            "masque" => $masque,
            "message" => $this->last_message
        ];
    }
protected function compileIn($key, $masque)
    {
        if (!preg_match("/^in:(.+)$/", $masque, $match)) {
            return;
        }

        $values = explode(",", end($match));

        foreach ($values as $index => $value) {
            $values[$index] = trim($value);
        }

        if (in_array($this->inputs[$key], $values)) {
            return;
        }

        $this->last_message = $this->lexique('in', [
            'attribute' => $key,
            'value' => implode(", ", $values)
        ]);

        $this->fails = true;

        $this->errors[$key][] = [
            "masque" => $masque,
            "message" => $this->last_message
        ];
    }
protected function compileIn ( $ key , $ masque ) { if ( ! preg_match ( "/^in:(.+)$/" , $ masque , $ match ) ) { return ; } $ values = explode ( "," , end ( $ match ) ) ; foreach ( $ values as $ index => $ value ) { $ values [ $ index ] = trim ( $ value ) ; } if ( in_array ( $ this -> inputs [ $ key ] , $ values ) ) { return ; } $ this -> last_message = $ this -> lexique ( 'in' , [ 'attribute' => $ key , 'value' => implode ( ", " , $ values ) ] ) ; $ this -> fails = true ; $ this -> errors [ $ key ] [ ] = [ "masque" => $ masque , "message" => $ this -> last_message ] ; }
Complie In Rule

[in:(value, ...)] Check that the contents of the field are equal to the defined value

@param string $key
@param string $masque

@return void
Complie In Rule