original_string: public function before($callback, $group = null, $methods = array())
      {
          $methods = array_map('strtoupper', $methods);
          if ($group === null) {
              if (self::$group !== null) {
                  $group = self::$group;
              } else {
                  $group = 'global';
              }
          }
  
          $this->addMiddleware(new Middleware($callback, 'before', $methods, $group));
      }
code: public function before($callback, $group = null, $methods = array())
      {
          $methods = array_map('strtoupper', $methods);
          if ($group === null) {
              if (self::$group !== null) {
                  $group = self::$group;
              } else {
                  $group = 'global';
              }
          }
  
          $this->addMiddleware(new Middleware($callback, 'before', $methods, $group));
      }
code_tokens: public function before ( $ callback , $ group = null , $ methods = array ( ) ) { $ methods = array_map ( 'strtoupper' , $ methods ) ; if ( $ group === null ) { if ( self :: $ group !== null ) { $ group = self :: $ group ; } else { $ group = 'global' ; } } $ this -> addMiddleware ( new Middleware ( $ callback , 'before' , $ methods , $ group ) ) ; }
docstring: Add before middleware.
  
  @param string|callable $callback
  @param string $group Optional group. leave empty for global. When in group define it will be filled with the active group name!
  @param array $methods Array of methods, leave undefined for all methods, 'GET'/'POST'/'PUT'/'DELETE'.
docstring_tokens: Add before middleware .