From 7e3298753a9f93405ef44b46ba4db4ca98553b51 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Sat, 14 Nov 2015 04:08:07 -0500 Subject: [PATCH] Use ternary operator where aplicable --- program/lib/Roundcube/rcube_spellchecker.php | 18 +++--------------- 1 files changed, 3 insertions(+), 15 deletions(-) diff --git a/program/lib/Roundcube/rcube_spellchecker.php b/program/lib/Roundcube/rcube_spellchecker.php index 0627807..a579cac 100644 --- a/program/lib/Roundcube/rcube_spellchecker.php +++ b/program/lib/Roundcube/rcube_spellchecker.php @@ -1,6 +1,6 @@ <?php -/* +/** +-----------------------------------------------------------------------+ | This file is part of the Roundcube Webmail client | | Copyright (C) 2011-2013, Kolab Systems AG | @@ -46,7 +46,7 @@ { $this->rc = rcube::get_instance(); $this->engine = $this->rc->config->get('spellcheck_engine', 'googie'); - $this->lang = $lang ? $lang : 'en'; + $this->lang = $lang ?: 'en'; $this->options = array( 'ignore_syms' => $this->rc->config->get('spellcheck_ignore_syms'), @@ -137,7 +137,6 @@ return $this->found() == 0; } - /** * Number of mispellings found (after check) * @@ -147,7 +146,6 @@ { return count($this->matches); } - /** * Returns suggestions for the specified word @@ -164,7 +162,6 @@ return array(); } - /** * Returns misspelled words @@ -187,7 +184,6 @@ return array(); } - /** * Returns checking result in XML (Googiespell) format * @@ -208,7 +204,6 @@ return $out; } - /** * Returns checking result (misspelled words with suggestions) @@ -243,7 +238,6 @@ return $result; } - /** * Returns error message * @@ -251,16 +245,14 @@ */ function error() { - return $this->error ? $this->error : ($this->backend ? $this->backend->error() : false); + return $this->error ?: ($this->backend ? $this->backend->error() : false); } - private function html2text($text) { $h2t = new rcube_html2text($text, false, true, 0); return $h2t->get_text(); } - /** * Check if the specified word is an exception accoring to @@ -300,7 +292,6 @@ return false; } - /** * Add a word to dictionary * @@ -324,7 +315,6 @@ } } - /** * Remove a word from dictionary * @@ -339,7 +329,6 @@ $this->update_dict(); } } - /** * Update dictionary row in DB @@ -382,7 +371,6 @@ $plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary'])); } } - /** * Get dictionary from DB -- Gitblit v1.9.1