original_string: protected function generatePaths()
      {
          if ($this->loginPath && !$this->loginCheckPath) {
              foreach ($this->patterns as $pattern) {
                  // remove the ^ prefix
                  $base = substr($pattern, 1);
                  // skip a regex pattern
                  if (preg_quote($base) != $base) {
                      continue;
                  }
                  // now that we found one
                  if (substr($base, -1) != '/') {
                      $base .= '/';
                  }
                  $this->loginCheckPath = $base.'login_check';
                  $this->logoutPath     = $base.'logout';
                  break;
              }
              // unable to generate since all patterns are regex
              if (!$this->loginCheckPath) {
                  static $underscorePad = 0;
                  $underscorePad++;
                  $this->loginCheckPath = '/'.str_repeat('_', $underscorePad).'login_check';
                  $this->logoutPath     = '/'.str_repeat('_', $underscorePad).'logout';
                  $this->patterns[]     = "^{$this->loginCheckPath}$";
                  $this->patterns[]     = "^{$this->logoutPath}$";
              }
          }
      }
code: protected function generatePaths()
      {
          if ($this->loginPath && !$this->loginCheckPath) {
              foreach ($this->patterns as $pattern) {
                  // remove the ^ prefix
                  $base = substr($pattern, 1);
                  // skip a regex pattern
                  if (preg_quote($base) != $base) {
                      continue;
                  }
                  // now that we found one
                  if (substr($base, -1) != '/') {
                      $base .= '/';
                  }
                  $this->loginCheckPath = $base.'login_check';
                  $this->logoutPath     = $base.'logout';
                  break;
              }
              // unable to generate since all patterns are regex
              if (!$this->loginCheckPath) {
                  static $underscorePad = 0;
                  $underscorePad++;
                  $this->loginCheckPath = '/'.str_repeat('_', $underscorePad).'login_check';
                  $this->logoutPath     = '/'.str_repeat('_', $underscorePad).'logout';
                  $this->patterns[]     = "^{$this->loginCheckPath}$";
                  $this->patterns[]     = "^{$this->logoutPath}$";
              }
          }
      }
code_tokens: protected function generatePaths ( ) { if ( $ this -> loginPath && ! $ this -> loginCheckPath ) { foreach ( $ this -> patterns as $ pattern ) { // remove the ^ prefix $ base = substr ( $ pattern , 1 ) ; // skip a regex pattern if ( preg_quote ( $ base ) != $ base ) { continue ; } // now that we found one if ( substr ( $ base , - 1 ) != '/' ) { $ base .= '/' ; } $ this -> loginCheckPath = $ base . 'login_check' ; $ this -> logoutPath = $ base . 'logout' ; break ; } // unable to generate since all patterns are regex if ( ! $ this -> loginCheckPath ) { static $ underscorePad = 0 ; $ underscorePad ++ ; $ this -> loginCheckPath = '/' . str_repeat ( '_' , $ underscorePad ) . 'login_check' ; $ this -> logoutPath = '/' . str_repeat ( '_' , $ underscorePad ) . 'logout' ; $ this -> patterns [ ] = "^{$this->loginCheckPath}$" ; $ this -> patterns [ ] = "^{$this->logoutPath}$" ; } } }
docstring: Generate loginCheckPath & logoutPath.
docstring_tokens: Generate loginCheckPath & logoutPath .