summaryrefslogtreecommitdiffstats
path: root/system/helpers/inflector_helper.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2011-07-02 00:54:49 +0200
committerDerek Jones <derek.jones@ellislab.com>2011-07-02 00:54:49 +0200
commit8f371a4954ec84f9ea80c26e654a4793714f8a07 (patch)
tree912d83e6e2adbe136d892f0a41ea1730dc11206a /system/helpers/inflector_helper.php
parent806b82448ddccece1311228519dc1410dacd0971 (diff)
parent4b9c62980599228f070b401c7673dce8085b0c61 (diff)
hand merged remaining unresolved files following the backout of 648b42a75739, which was a NON-trivial whitespace commit
Diffstat (limited to 'system/helpers/inflector_helper.php')
-rw-r--r--system/helpers/inflector_helper.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php
index 2352b642e..c7c113b8a 100644
--- a/system/helpers/inflector_helper.php
+++ b/system/helpers/inflector_helper.php
@@ -1,4 +1,4 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
@@ -43,9 +43,9 @@ if ( ! function_exists('singular'))
{
$str = trim($str);
$end = substr($str, -3);
-
- $str = preg_replace('/(.*)?([s|c]h)es/i','$1$2',$str);
-
+
+ $str = preg_replace('/(.*)?([s|c]h)es/i','$1$2',$str);
+
if (strtolower($end) == 'ies')
{
$str = substr($str, 0, strlen($str)-3).(preg_match('/[a-z]/',$end) ? 'y' : 'Y');
@@ -83,8 +83,8 @@ if ( ! function_exists('singular'))
if ( ! function_exists('plural'))
{
function plural($str, $force = FALSE)
- {
- $str = trim($str);
+ {
+ $str = trim($str);
$end = substr($str, -1);
if (preg_match('/y/i',$end))
@@ -95,7 +95,7 @@ if ( ! function_exists('plural'))
}
elseif (preg_match('/h/i',$end))
{
- if(preg_match('/^[c|s]h$/i',substr($str, -2)))
+ if(preg_match('/^[c|s]h$/i',substr($str, -2)))
{
$str .= 'es';
}