From e84fb806f8db5defcc509088793b0712b5709483 Mon Sep 17 00:00:00 2001 From: Phill Sparks Date: Thu, 10 Nov 2011 00:39:30 +0000 Subject: [PATCH 1/3] Fixed plural count check --- laravel/inflector.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/inflector.php b/laravel/inflector.php index c0c8550a..01666199 100644 --- a/laravel/inflector.php +++ b/laravel/inflector.php @@ -138,7 +138,7 @@ class Inflector { */ public static function plural($value, $count = null) { - if ( ! is_null($count) and $count <= 1) return $value; + if ( ! is_null($count) and $count == 1) return $value; $irregular = array_flip(static::$irregular); @@ -200,4 +200,4 @@ private static function inflect($value, $cache, $irregular, $source) return $value; } -} \ No newline at end of file +} From 932dec6af74040dc4260278ec816a058ecbb0d67 Mon Sep 17 00:00:00 2001 From: Phill Sparks Date: Thu, 10 Nov 2011 00:40:45 +0000 Subject: [PATCH 2/3] Added more uncountables, the list could go on --- laravel/inflector.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/laravel/inflector.php b/laravel/inflector.php index 01666199..08026c85 100644 --- a/laravel/inflector.php +++ b/laravel/inflector.php @@ -102,13 +102,16 @@ class Inflector { * @var array */ private static $uncountable = array( + 'audio', 'equipment', 'data', 'deer', 'fish', + 'gold', 'information', 'money', 'rice', + 'police', 'series', 'sheep', 'species', From 5da8c1e1d9f10da9c017fda1c6ddf7123b6d891d Mon Sep 17 00:00:00 2001 From: Phill Sparks Date: Thu, 10 Nov 2011 00:44:26 +0000 Subject: [PATCH 3/3] Data is countable, it's plural of datum --- laravel/inflector.php | 1 - 1 file changed, 1 deletion(-) diff --git a/laravel/inflector.php b/laravel/inflector.php index 08026c85..23e30f60 100644 --- a/laravel/inflector.php +++ b/laravel/inflector.php @@ -104,7 +104,6 @@ class Inflector { private static $uncountable = array( 'audio', 'equipment', - 'data', 'deer', 'fish', 'gold',