From 6e9d03ee45d0980c6730233547d7d508f084bd15 Mon Sep 17 00:00:00 2001 From: Michael Francis Date: Sun, 10 Jul 2011 22:07:28 -0400 Subject: Code cleanup --- models/Post.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/models/Post.php b/models/Post.php index ec82ca2..bb3abd7 100644 --- a/models/Post.php +++ b/models/Post.php @@ -26,13 +26,9 @@ class Post extends \lithium\data\Model { */ public function parse($entity, $input) { - $words; - if (is_array($input)) { - $words = $input; - } - else { - $words = explode(" ", $input); - } + + //If $input is an array, set words to it otherwise, explode it. + $words = (is_array($input)) ? $input : explode(" ", $input); //Count the number of words $count = count($words); -- cgit v1.2.3