original_string: public static function singlelise($string)
      {
          $rules = [
              'ies' => 'y',
              'ves' => 'f',
              's'   => '',
          ];
  
          foreach ($rules as $ending => $replacement) {
              if ($ending === substr($string, -strlen($ending))) {
                  return substr($string, 0, -strlen($ending)) . $replacement;
              }
          }
  
          return $string . 'Single';
      }
code: public static function singlelise($string)
      {
          $rules = [
              'ies' => 'y',
              'ves' => 'f',
              's'   => '',
          ];
  
          foreach ($rules as $ending => $replacement) {
              if ($ending === substr($string, -strlen($ending))) {
                  return substr($string, 0, -strlen($ending)) . $replacement;
              }
          }
  
          return $string . 'Single';
      }
code_tokens: public static function singlelise ( $ string ) { $ rules = [ 'ies' => 'y' , 'ves' => 'f' , 's' => '' , ] ; foreach ( $ rules as $ ending => $ replacement ) { if ( $ ending === substr ( $ string , - strlen ( $ ending ) ) ) { return substr ( $ string , 0 , - strlen ( $ ending ) ) . $ replacement ; } } return $ string . 'Single' ; }
docstring: Get the plural name from a singular
  
  @param string $string
  
  @return string
docstring_tokens: Get the plural name from a singular