- 🇮🇹Italy apaderno Brescia, 🇮🇹
+ /** + * The spelling suggestion + * @var array + */ + private $suggestion = NULL;
Since that property is initialized to
NULL
, its type should also include that.+ * Get Spelling Suggestion. + * + * @return array The extra parameters to CSE.
The return value description goes to a new line.
+ // save spelling suggetion + $this->suggestion = (string)$results->Spelling->Suggestion; +
Comments are sentences: They start with a capitalized word and end with a period.
suggetion is misspelled.+ if(!empty($spelling_suggestion) && is_string($spelling_suggestion) ) { + $html .= '<span>' . t("Did you mean ") . l($spelling_suggestion, 'search/gss/'.$spelling_suggestion) . '</span><ul>'; + }
There must be a space after
if
.
There is an extraneous space between the closing parentheses.
Strings passed tot()
needs to use placeholders.
I am not sure it is necessary to usel()
in this case.I would also leave fixing any coding standards issue to a different issue. This is about implementing a feature and it should be limited to that. At least, the patch would still be valid even when the coding standards are fixed.
- 🇮🇹Italy apaderno Brescia, 🇮🇹
I am not sure the maintainers will add this feature, though. The project page says:
We discourage use this module, since Google decided to discontinue Google Site Search as a paid service.
If Google Site Search has been discontinued, new features cannot be used.