protected function checkRule($rule)
    {
        $this->assertTrue(is_array($rule) || is_string($rule));

        $parts = is_array($rule) ? $rule : explode('|', $rule);

        $this->assertTrue(isset($parts[0]));

        if ($this->enforceRequiredOrNullable()) {
            $this->assertTrue($parts[0] === 'required' || $parts[0] === 'nullable');
        }

        foreach ($parts as $part) {
            $this->assertInternalType('string', $part);
        }
    }
protected function checkRule($rule)
    {
        $this->assertTrue(is_array($rule) || is_string($rule));

        $parts = is_array($rule) ? $rule : explode('|', $rule);

        $this->assertTrue(isset($parts[0]));

        if ($this->enforceRequiredOrNullable()) {
            $this->assertTrue($parts[0] === 'required' || $parts[0] === 'nullable');
        }

        foreach ($parts as $part) {
            $this->assertInternalType('string', $part);
        }
    }
protected function checkRule ( $ rule ) { $ this -> assertTrue ( is_array ( $ rule ) || is_string ( $ rule ) ) ; $ parts = is_array ( $ rule ) ? $ rule : explode ( '|' , $ rule ) ; $ this -> assertTrue ( isset ( $ parts [ 0 ] ) ) ; if ( $ this -> enforceRequiredOrNullable ( ) ) { $ this -> assertTrue ( $ parts [ 0 ] === 'required' || $ parts [ 0 ] === 'nullable' ) ; } foreach ( $ parts as $ part ) { $ this -> assertInternalType ( 'string' , $ part ) ; } }
Check the given validation rule is valid.

@param string[]|string $rule

@return void
Check the given validation rule is valid .