aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/FullTextSearch/Model/SearchTemplate.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/FullTextSearch/Model/SearchTemplate.php')
-rw-r--r--lib/private/FullTextSearch/Model/SearchTemplate.php79
1 files changed, 10 insertions, 69 deletions
diff --git a/lib/private/FullTextSearch/Model/SearchTemplate.php b/lib/private/FullTextSearch/Model/SearchTemplate.php
index 4bb56f24b58..6f9a04a911e 100644
--- a/lib/private/FullTextSearch/Model/SearchTemplate.php
+++ b/lib/private/FullTextSearch/Model/SearchTemplate.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2018
- *
- * @author Maxence Lange <maxence@artificial-owl.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\FullTextSearch\Model;
@@ -37,7 +20,7 @@ use OCP\FullTextSearch\Model\ISearchTemplate;
* when the getSearchTemplate() method is called.
*
* The object will contain templates to be displayed, and the list of the different
- * options to be available to the user when he start a new search.
+ * options to be available to the user when they start a new search.
*
* The display of the Options is generated by the FullTextSearch app and Options
* can be displayed in 2 places:
@@ -56,21 +39,13 @@ use OCP\FullTextSearch\Model\ISearchTemplate;
* @package OC\FullTextSearch\Model
*/
final class SearchTemplate implements ISearchTemplate, JsonSerializable {
- /** @var string */
- private $icon = '';
-
- /** @var string */
- private $css = '';
-
- /** @var string */
- private $template = '';
+ private string $template = '';
/** @var SearchOption[] */
- private $panelOptions = [];
+ private array $panelOptions = [];
/** @var SearchOption[] */
- private $navigationOptions = [];
-
+ private array $navigationOptions = [];
/**
* ISearchTemplate constructor.
@@ -79,13 +54,11 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
* creation of the object.
*
* @since 15.0.0
- *
- * @param string $icon
- * @param string $css
*/
- public function __construct(string $icon = '', string $css = '') {
- $this->icon = $icon;
- $this->css = $css;
+ public function __construct(
+ private string $icon = '',
+ private string $css = '',
+ ) {
}
@@ -94,10 +67,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
* FullTextSearch navigation page, in front of the related Content Provider.
*
* @since 15.0.0
- *
- * @param string $class
- *
- * @return ISearchTemplate
*/
public function setIcon(string $class): ISearchTemplate {
$this->icon = $class;
@@ -107,10 +76,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
/**
* Get the class of the icon.
- *
- * @since 15.0.0
- *
- * @return string
*/
public function getIcon(): string {
return $this->icon;
@@ -121,10 +86,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
* Set the path of a CSS file that will be loaded when needed.
*
* @since 15.0.0
- *
- * @param string $css
- *
- * @return ISearchTemplate
*/
public function setCss(string $css): ISearchTemplate {
$this->css = $css;
@@ -136,8 +97,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
* Get the path of the CSS file.
*
* @since 15.0.0
- *
- * @return string
*/
public function getCss(): string {
return $this->css;
@@ -151,10 +110,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
* a way not generated by FullTextSearch
*
* @since 15.0.0
- *
- * @param string $template
- *
- * @return ISearchTemplate
*/
public function setTemplate(string $template): ISearchTemplate {
$this->template = $template;
@@ -166,8 +121,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
* Get the path of the template file.
*
* @since 15.0.0
- *
- * @return string
*/
public function getTemplate(): string {
return $this->template;
@@ -181,10 +134,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
* @see ISearchOption
*
* @since 15.0.0
- *
- * @param ISearchOption $option
- *
- * @return ISearchTemplate
*/
public function addPanelOption(ISearchOption $option): ISearchTemplate {
$this->panelOptions[] = $option;
@@ -210,10 +159,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
* @see ISearchOption
*
* @since 15.0.0
- *
- * @param ISearchOption $option
- *
- * @return ISearchTemplate
*/
public function addNavigationOption(ISearchOption $option): ISearchTemplate {
$this->navigationOptions[] = $option;
@@ -225,8 +170,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
* Get all options to be displayed in the FullTextSearch navigation page.
*
* @since 15.0.0
- *
- * @return array
*/
public function getNavigationOptions(): array {
return $this->navigationOptions;
@@ -235,8 +178,6 @@ final class SearchTemplate implements ISearchTemplate, JsonSerializable {
/**
* @since 15.0.0
- *
- * @return array
*/
public function jsonSerialize(): array {
return [