Ignore:
Timestamp:
Feb 20, 2014 3:03:59 AM (10 years ago)
Author:
anonymous
Message:

Completed integrating /branches/eli_branch into /trunk. Changes include:

  • Removed closing ?> from end of files
  • Upgrade old-style contructor methods to use construct() instead.
  • Class properties and methods defined as public, private, static or protected
  • Ensure code runs under E_ALL with only mysql_* deprecated warnings
  • Search for the '@' symbol anywhere it might be used to supress runtime errors, then replace with proper error recovery.
  • Run the php cli -l option to check files for syntax errors.
  • Bring tests up-to-date with latest version and methods of PHPUnit
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/lib/SpellCheck.inc.php

    r425 r468  
    6161class SpellCheck {
    6262
    63     var $_params = array(
     63    private $_params = array(
    6464        'language' => 'en',
    6565        'personal_wordlist' => '', // Text file to save custom words to.
     
    7070    );
    7171
    72     var $_pspell_cfg_handle;
    73     var $_pspell_handle;
    74     var $_use_personal_wordlist = false;
    75     var $_errors = array();
     72    private $_pspell_cfg_handle;
     73    private $_pspell_handle;
     74    private $_use_personal_wordlist = false;
     75    private $_errors = array();
    7676
    7777    /**
     
    8080     * @param  array    $params     Array of parameters (key => val pairs).
    8181     */
    82     function SpellCheck($params)
     82    public function __construct($params)
    8383    {
    8484        $app =& App::getInstance();
     
    118118     * @param  array    $params     Array of parameters (key => val pairs).
    119119     */
    120     function setParam($params)
     120    public function setParam($params)
    121121    {
    122122        $app =& App::getInstance();
     
    137137     * @return mixed               Configured parameter value.
    138138     */
    139     function getParam($param)
     139    public function getParam($param)
    140140    {
    141141        $app =& App::getInstance();
     
    154154     * @return bool   True if any errors were found, false otherwise.
    155155     */
    156     function anyErrors()
     156    public function anyErrors()
    157157    {
    158158        return (sizeof($this->_errors) > 0);
     
    162162     * Reset the error list.
    163163     */
    164     function resetErrorList()
     164    public function resetErrorList()
    165165    {
    166166        $this->_errors = array();
     
    177177     * @since   09 Jun 2005 18:23:51
    178178     */
    179     function check($word)
     179    public function check($word)
    180180    {
    181181        if (pspell_check($this->_pspell_handle, $word)) {
     
    197197     * @since   09 Jun 2005 18:23:51
    198198     */
    199     function suggest($word)
     199    public function suggest($word)
    200200    {
    201201        return pspell_suggest($this->_pspell_handle, $word);
     
    212212     * @since   09 Jun 2005 18:23:51
    213213     */
    214     function add($word)
     214    public function add($word)
    215215    {
    216216        $app =& App::getInstance();
     
    237237     * @since   09 Jun 2005 18:23:51
    238238     */
    239     function save()
     239    public function save()
    240240    {
    241241        $app =& App::getInstance();
     
    263263     * @since   09 Jun 2005 21:29:49
    264264     */
    265     function getStringSuggestions($string)
     265    public function getStringSuggestions($string)
    266266    {
    267267        $corrections = array();
     
    299299     * @since   09 Jun 2005 22:11:27
    300300     */
    301     function checkString($string)
     301    public function checkString($string)
    302302    {
    303303        $errors = array();
     
    331331     * @since   09 Jun 2005 21:29:49
    332332     */
    333     function getStringHighlighted($string, $show_footnote=false)
     333    public function getStringHighlighted($string, $show_footnote=false)
    334334    {
    335335        $words = preg_split('/([\W]+?)/', $string, -1, PREG_SPLIT_DELIM_CAPTURE);
     
    357357     * @since   09 Jun 2005 21:29:49
    358358     */
    359     function printCorrectionForm($form_name)
     359    public function printCorrectionForm($form_name)
    360360    {
    361361        ?>
     
    402402     * @since   09 Jun 2005 23:15:35
    403403     */
    404     function anyFormCorrections()
     404    public function anyFormCorrections()
    405405    {
    406406        return (false !== getFormData('spelling_suggestions', false)) || (false !== getFormData('spelling_corrections', false));
     
    417417     * @since   09 Jun 2005 23:18:51
    418418     */
    419     function applyFormCorrections($form_name)
     419    public function applyFormCorrections($form_name)
    420420    {
    421421        $form_words = preg_split('/([\W]+?)/', getFormData($form_name), -1, PREG_SPLIT_DELIM_CAPTURE);
     
    445445} // End.
    446446
    447 ?>
Note: See TracChangeset for help on using the changeset viewer.