Skip to content

Commit

Permalink
Merge pull request #14302 from nextcloud/enhancement/noid/fulltextsea…
Browse files Browse the repository at this point in the history
…rch-final-class

nc16/fulltetsearch: moving final class to private, new interface in public
  • Loading branch information
MorrisJobke authored Mar 5, 2019
2 parents 1aad010 + adfadf8 commit 5decee6
Show file tree
Hide file tree
Showing 15 changed files with 1,497 additions and 231 deletions.
12 changes: 8 additions & 4 deletions lib/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@
'OCP\\FullTextSearch\\IFullTextSearchManager' => $baseDir . '/lib/public/FullTextSearch/IFullTextSearchManager.php',
'OCP\\FullTextSearch\\IFullTextSearchPlatform' => $baseDir . '/lib/public/FullTextSearch/IFullTextSearchPlatform.php',
'OCP\\FullTextSearch\\IFullTextSearchProvider' => $baseDir . '/lib/public/FullTextSearch/IFullTextSearchProvider.php',
'OCP\\FullTextSearch\\Model\\DocumentAccess' => $baseDir . '/lib/public/FullTextSearch/Model/DocumentAccess.php',
'OCP\\FullTextSearch\\Model\\IDocumentAccess' => $baseDir . '/lib/public/FullTextSearch/Model/IDocumentAccess.php',
'OCP\\FullTextSearch\\Model\\IIndex' => $baseDir . '/lib/public/FullTextSearch/Model/IIndex.php',
'OCP\\FullTextSearch\\Model\\IIndexDocument' => $baseDir . '/lib/public/FullTextSearch/Model/IIndexDocument.php',
'OCP\\FullTextSearch\\Model\\IIndexOptions' => $baseDir . '/lib/public/FullTextSearch/Model/IIndexOptions.php',
'OCP\\FullTextSearch\\Model\\IRunner' => $baseDir . '/lib/public/FullTextSearch/Model/IRunner.php',
'OCP\\FullTextSearch\\Model\\ISearchOption' => $baseDir . '/lib/public/FullTextSearch/Model/ISearchOption.php',
'OCP\\FullTextSearch\\Model\\ISearchRequest' => $baseDir . '/lib/public/FullTextSearch/Model/ISearchRequest.php',
'OCP\\FullTextSearch\\Model\\ISearchResult' => $baseDir . '/lib/public/FullTextSearch/Model/ISearchResult.php',
'OCP\\FullTextSearch\\Model\\IndexDocument' => $baseDir . '/lib/public/FullTextSearch/Model/IndexDocument.php',
'OCP\\FullTextSearch\\Model\\SearchOption' => $baseDir . '/lib/public/FullTextSearch/Model/SearchOption.php',
'OCP\\FullTextSearch\\Model\\SearchTemplate' => $baseDir . '/lib/public/FullTextSearch/Model/SearchTemplate.php',
'OCP\\FullTextSearch\\Model\\ISearchTemplate' => $baseDir . '/lib/public/FullTextSearch/Model/ISearchTemplate.php',
'OCP\\FullTextSearch\\Service\\IIndexService' => $baseDir . '/lib/public/FullTextSearch/Service/IIndexService.php',
'OCP\\FullTextSearch\\Service\\IProviderService' => $baseDir . '/lib/public/FullTextSearch/Service/IProviderService.php',
'OCP\\FullTextSearch\\Service\\ISearchService' => $baseDir . '/lib/public/FullTextSearch/Service/ISearchService.php',
Expand Down Expand Up @@ -874,6 +874,10 @@
'OC\\Files\\View' => $baseDir . '/lib/private/Files/View.php',
'OC\\ForbiddenException' => $baseDir . '/lib/private/ForbiddenException.php',
'OC\\FullTextSearch\\FullTextSearchManager' => $baseDir . '/lib/private/FullTextSearch/FullTextSearchManager.php',
'OC\\FullTextSearch\\Model\\DocumentAccess' => $baseDir . '/lib/private/FullTextSearch/Model/DocumentAccess.php',
'OC\\FullTextSearch\\Model\\IndexDocument' => $baseDir . '/lib/private/FullTextSearch/Model/IndexDocument.php',
'OC\\FullTextSearch\\Model\\SearchOption' => $baseDir . '/lib/private/FullTextSearch/Model/SearchOption.php',
'OC\\FullTextSearch\\Model\\SearchTemplate' => $baseDir . '/lib/private/FullTextSearch/Model/SearchTemplate.php',
'OC\\GlobalScale\\Config' => $baseDir . '/lib/private/GlobalScale/Config.php',
'OC\\Group\\Backend' => $baseDir . '/lib/private/Group/Backend.php',
'OC\\Group\\Database' => $baseDir . '/lib/private/Group/Database.php',
Expand Down
12 changes: 8 additions & 4 deletions lib/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OCP\\FullTextSearch\\IFullTextSearchManager' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/IFullTextSearchManager.php',
'OCP\\FullTextSearch\\IFullTextSearchPlatform' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/IFullTextSearchPlatform.php',
'OCP\\FullTextSearch\\IFullTextSearchProvider' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/IFullTextSearchProvider.php',
'OCP\\FullTextSearch\\Model\\DocumentAccess' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/DocumentAccess.php',
'OCP\\FullTextSearch\\Model\\IDocumentAccess' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/IDocumentAccess.php',
'OCP\\FullTextSearch\\Model\\IIndex' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/IIndex.php',
'OCP\\FullTextSearch\\Model\\IIndexDocument' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/IIndexDocument.php',
'OCP\\FullTextSearch\\Model\\IIndexOptions' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/IIndexOptions.php',
'OCP\\FullTextSearch\\Model\\IRunner' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/IRunner.php',
'OCP\\FullTextSearch\\Model\\ISearchOption' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/ISearchOption.php',
'OCP\\FullTextSearch\\Model\\ISearchRequest' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/ISearchRequest.php',
'OCP\\FullTextSearch\\Model\\ISearchResult' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/ISearchResult.php',
'OCP\\FullTextSearch\\Model\\IndexDocument' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/IndexDocument.php',
'OCP\\FullTextSearch\\Model\\SearchOption' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/SearchOption.php',
'OCP\\FullTextSearch\\Model\\SearchTemplate' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/SearchTemplate.php',
'OCP\\FullTextSearch\\Model\\ISearchTemplate' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Model/ISearchTemplate.php',
'OCP\\FullTextSearch\\Service\\IIndexService' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Service/IIndexService.php',
'OCP\\FullTextSearch\\Service\\IProviderService' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Service/IProviderService.php',
'OCP\\FullTextSearch\\Service\\ISearchService' => __DIR__ . '/../../..' . '/lib/public/FullTextSearch/Service/ISearchService.php',
Expand Down Expand Up @@ -904,6 +904,10 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Files\\View' => __DIR__ . '/../../..' . '/lib/private/Files/View.php',
'OC\\ForbiddenException' => __DIR__ . '/../../..' . '/lib/private/ForbiddenException.php',
'OC\\FullTextSearch\\FullTextSearchManager' => __DIR__ . '/../../..' . '/lib/private/FullTextSearch/FullTextSearchManager.php',
'OC\\FullTextSearch\\Model\\DocumentAccess' => __DIR__ . '/../../..' . '/lib/private/FullTextSearch/Model/DocumentAccess.php',
'OC\\FullTextSearch\\Model\\IndexDocument' => __DIR__ . '/../../..' . '/lib/private/FullTextSearch/Model/IndexDocument.php',
'OC\\FullTextSearch\\Model\\SearchOption' => __DIR__ . '/../../..' . '/lib/private/FullTextSearch/Model/SearchOption.php',
'OC\\FullTextSearch\\Model\\SearchTemplate' => __DIR__ . '/../../..' . '/lib/private/FullTextSearch/Model/SearchTemplate.php',
'OC\\GlobalScale\\Config' => __DIR__ . '/../../..' . '/lib/private/GlobalScale/Config.php',
'OC\\Group\\Backend' => __DIR__ . '/../../..' . '/lib/private/Group/Backend.php',
'OC\\Group\\Database' => __DIR__ . '/../../..' . '/lib/private/Group/Database.php',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
*/


namespace OCP\FullTextSearch\Model;
namespace OC\FullTextSearch\Model;


use JsonSerializable;
use OCP\FullTextSearch\Model\IDocumentAccess;


/**
* Class DocumentAccess
* Class IDocumentAccess
*
* This object is used as a data transfer object when
*
Expand All @@ -48,13 +49,14 @@
* During the search, it is internally use to define to which group, circles, ...
* a user that perform the search belongs to.
*
* @see IndexDocument::setAccess
* @see IIndexDocument::setAccess
*
* @since 15.0.0
* @since 16.0.0
*
* @package OCP\FullTextSearch\Model
* @package OC\FullTextSearch\Model
*/
final class DocumentAccess implements JsonSerializable {
final class DocumentAccess implements IDocumentAccess, JsonSerializable {


/** @var string */
private $ownerId;
Expand All @@ -78,9 +80,9 @@ final class DocumentAccess implements JsonSerializable {
/**
* Owner of the document can be set at the init of the object.
*
* @since 15.0.0
* @since 16.0.0
*
* DocumentAccess constructor.
* IDocumentAccess constructor.
*
* @param string $ownerId
*/
Expand All @@ -92,13 +94,13 @@ public function __construct(string $ownerId = '') {
/**
* Set the Owner of the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param string $ownerId
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function setOwnerId(string $ownerId) {
public function setOwnerId(string $ownerId): IDocumentAccess {
$this->ownerId = $ownerId;

return $this;
Expand All @@ -107,7 +109,7 @@ public function setOwnerId(string $ownerId) {
/**
* Get the Owner of the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @return string
*/
Expand All @@ -119,13 +121,13 @@ public function getOwnerId(): string {
/**
* Set the viewer of the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param string $viewerId
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function setViewerId(string $viewerId): DocumentAccess {
public function setViewerId(string $viewerId): IDocumentAccess {
$this->viewerId = $viewerId;

return $this;
Expand All @@ -134,7 +136,7 @@ public function setViewerId(string $viewerId): DocumentAccess {
/**
* Get the viewer of the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @return string
*/
Expand All @@ -146,13 +148,13 @@ public function getViewerId(): string {
/**
* Set the list of users that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param array $users
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function setUsers(array $users): DocumentAccess {
public function setUsers(array $users): IDocumentAccess {
$this->users = $users;

return $this;
Expand All @@ -161,13 +163,13 @@ public function setUsers(array $users): DocumentAccess {
/**
* Add an entry to the list of users that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param string $user
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function addUser(string $user): DocumentAccess {
public function addUser(string $user): IDocumentAccess {
$this->users[] = $user;

return $this;
Expand All @@ -177,13 +179,13 @@ public function addUser(string $user): DocumentAccess {
* Add multiple entries to the list of users that have read access to the
* document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param array $users
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function addUsers($users): DocumentAccess {
public function addUsers($users): IDocumentAccess {
$this->users = array_merge($this->users, $users);

return $this;
Expand All @@ -192,7 +194,7 @@ public function addUsers($users): DocumentAccess {
/**
* Get the complete list of users that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @return array
*/
Expand All @@ -204,13 +206,13 @@ public function getUsers(): array {
/**
* Set the list of groups that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param array $groups
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function setGroups(array $groups): DocumentAccess {
public function setGroups(array $groups): IDocumentAccess {
$this->groups = $groups;

return $this;
Expand All @@ -219,13 +221,13 @@ public function setGroups(array $groups): DocumentAccess {
/**
* Add an entry to the list of groups that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param string $group
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function addGroup(string $group): DocumentAccess {
public function addGroup(string $group): IDocumentAccess {
$this->groups[] = $group;

return $this;
Expand All @@ -235,11 +237,11 @@ public function addGroup(string $group): DocumentAccess {
* Add multiple entries to the list of groups that have read access to the
* document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param array $groups
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function addGroups(array $groups) {
$this->groups = array_merge($this->groups, $groups);
Expand All @@ -250,7 +252,7 @@ public function addGroups(array $groups) {
/**
* Get the complete list of groups that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @return array
*/
Expand All @@ -262,13 +264,13 @@ public function getGroups(): array {
/**
* Set the list of circles that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param array $circles
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function setCircles(array $circles): DocumentAccess {
public function setCircles(array $circles): IDocumentAccess {
$this->circles = $circles;

return $this;
Expand All @@ -277,13 +279,13 @@ public function setCircles(array $circles): DocumentAccess {
/**
* Add an entry to the list of circles that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param string $circle
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function addCircle(string $circle): DocumentAccess {
public function addCircle(string $circle): IDocumentAccess {
$this->circles[] = $circle;

return $this;
Expand All @@ -293,13 +295,13 @@ public function addCircle(string $circle): DocumentAccess {
* Add multiple entries to the list of groups that have read access to the
* document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param array $circles
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function addCircles(array $circles): DocumentAccess {
public function addCircles(array $circles): IDocumentAccess {
$this->circles = array_merge($this->circles, $circles);

return $this;
Expand All @@ -308,7 +310,7 @@ public function addCircles(array $circles): DocumentAccess {
/**
* Get the complete list of circles that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @return array
*/
Expand All @@ -320,13 +322,13 @@ public function getCircles(): array {
/**
* Set the list of links that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @param array $links
*
* @return DocumentAccess
* @return IDocumentAccess
*/
public function setLinks(array $links): DocumentAccess {
public function setLinks(array $links): IDocumentAccess {
$this->links = $links;

return $this;
Expand All @@ -335,7 +337,7 @@ public function setLinks(array $links): DocumentAccess {
/**
* Get the list of links that have read access to the document.
*
* @since 15.0.0
* @since 16.0.0
*
* @return array
*/
Expand All @@ -345,7 +347,7 @@ public function getLinks(): array {


/**
* @since 15.0.0
* @since 16.0.0
*
* @return array
*/
Expand Down
Loading

0 comments on commit 5decee6

Please sign in to comment.