summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Francis <edude03@gmail.com>2011-07-10 22:07:28 -0400
committerMichael Francis <edude03@gmail.com>2011-07-10 22:07:28 -0400
commit6e9d03ee45d0980c6730233547d7d508f084bd15 (patch)
treee903cd503fb327496231b9a3017f93ce8ca6d808
parent98037454a89bdb95bc7ac246974bf48837e0a143 (diff)
downloadotakuhub-6e9d03ee45d0980c6730233547d7d508f084bd15.tar.xz
Code cleanup
-rw-r--r--models/Post.php10
1 files 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);