original_string: public function validationCustom(Validator $validator)
      {
          return $this->validationWidget($validator)
              ->requirePresence('body')
              ->add('body', [
                  'notBlank' => [
                      'rule' => 'notBlank',
                      'message' => __d('block', "You need to provide a content for block's body."),
                  ],
                  'length' => [
                      'rule' => ['minLength', 3],
                      'message' => __d('block', "Block's body need to be at least 3 characters long."),
                  ],
              ]);
      }
code: public function validationCustom(Validator $validator)
      {
          return $this->validationWidget($validator)
              ->requirePresence('body')
              ->add('body', [
                  'notBlank' => [
                      'rule' => 'notBlank',
                      'message' => __d('block', "You need to provide a content for block's body."),
                  ],
                  'length' => [
                      'rule' => ['minLength', 3],
                      'message' => __d('block', "Block's body need to be at least 3 characters long."),
                  ],
              ]);
      }
code_tokens: public function validationCustom ( Validator $ validator ) { return $ this -> validationWidget ( $ validator ) -> requirePresence ( 'body' ) -> add ( 'body' , [ 'notBlank' => [ 'rule' => 'notBlank' , 'message' => __d ( 'block' , "You need to provide a content for block's body." ) , ] , 'length' => [ 'rule' => [ 'minLength' , 3 ] , 'message' => __d ( 'block' , "Block's body need to be at least 3 characters long." ) , ] , ] ) ; }
docstring: Validation rules for custom blocks.
  
  Plugins may define their own blocks, in these cases the "body" value is
  optional. But blocks created by users (on the Blocks administration page)
  are required to have a valid "body".
  
  @param \Cake\Validation\Validator $validator The validator object
  @return \Cake\Validation\Validator
docstring_tokens: Validation rules for custom blocks .