original_string: public function normalizeFormTagOptions($urlOptions, $options, $block)
      {
          if (!$urlOptions || !$options || !$block) {
              if ($urlOptions instanceof Closure) {
                  $block     = $urlOptions;
                  $urlOptions = null;
                  $options     = [];
              } elseif (is_array($urlOptions) && is_string(key($urlOptions))) {
                  $block = $options;
                  $options = $urlOptions;
                  $urlOptions = null;
              } elseif ($options instanceof Closure) {
                  $block = $options;
                  $options = [];
              }
          }
          
          if (!$block instanceof Closure) {
              throw new Exception\BadMethodCallException(
                  "One of the arguments for formTag must be a Closure"
              );
          }
          
          if (empty($options['method'])) {
              $options['method'] = 'post';
          }
          
          if (!empty($options['multipart'])) {
              $options['enctype'] = 'multipart/form-data';
              unset($options['multipart']);
          }
          
          if ($urlOptions) {
              if (!$this->isUrl($urlOptions)) {
                  $options['action'] = $this->urlFor($urlOptions);
              } else {
                  $options['action'] = $urlOptions;
              }
          }
          
          return [$urlOptions, $options, $block];
      }
code: public function normalizeFormTagOptions($urlOptions, $options, $block)
      {
          if (!$urlOptions || !$options || !$block) {
              if ($urlOptions instanceof Closure) {
                  $block     = $urlOptions;
                  $urlOptions = null;
                  $options     = [];
              } elseif (is_array($urlOptions) && is_string(key($urlOptions))) {
                  $block = $options;
                  $options = $urlOptions;
                  $urlOptions = null;
              } elseif ($options instanceof Closure) {
                  $block = $options;
                  $options = [];
              }
          }
          
          if (!$block instanceof Closure) {
              throw new Exception\BadMethodCallException(
                  "One of the arguments for formTag must be a Closure"
              );
          }
          
          if (empty($options['method'])) {
              $options['method'] = 'post';
          }
          
          if (!empty($options['multipart'])) {
              $options['enctype'] = 'multipart/form-data';
              unset($options['multipart']);
          }
          
          if ($urlOptions) {
              if (!$this->isUrl($urlOptions)) {
                  $options['action'] = $this->urlFor($urlOptions);
              } else {
                  $options['action'] = $urlOptions;
              }
          }
          
          return [$urlOptions, $options, $block];
      }
code_tokens: public function normalizeFormTagOptions ( $ urlOptions , $ options , $ block ) { if ( ! $ urlOptions || ! $ options || ! $ block ) { if ( $ urlOptions instanceof Closure ) { $ block = $ urlOptions ; $ urlOptions = null ; $ options = [ ] ; } elseif ( is_array ( $ urlOptions ) && is_string ( key ( $ urlOptions ) ) ) { $ block = $ options ; $ options = $ urlOptions ; $ urlOptions = null ; } elseif ( $ options instanceof Closure ) { $ block = $ options ; $ options = [ ] ; } } if ( ! $ block instanceof Closure ) { throw new Exception \ BadMethodCallException ( "One of the arguments for formTag must be a Closure" ) ; } if ( empty ( $ options [ 'method' ] ) ) { $ options [ 'method' ] = 'post' ; } if ( ! empty ( $ options [ 'multipart' ] ) ) { $ options [ 'enctype' ] = 'multipart/form-data' ; unset ( $ options [ 'multipart' ] ) ; } if ( $ urlOptions ) { if ( ! $ this -> isUrl ( $ urlOptions ) ) { $ options [ 'action' ] = $ this -> urlFor ( $ urlOptions ) ; } else { $ options [ 'action' ] = $ urlOptions ; } } return [ $ urlOptions , $ options , $ block ] ; }
docstring: This method may be "extended" to customize form options such as HTML attributes.
docstring_tokens: This method may be extended to customize form options such as HTML attributes .