@@ -36,101 +36,101 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | trait VisibilityTrait { |
| 38 | 38 | |
| 39 | - /** @var int visibility */ |
|
| 40 | - protected $visibility = BackendService::VISIBILITY_DEFAULT; |
|
| 39 | + /** @var int visibility */ |
|
| 40 | + protected $visibility = BackendService::VISIBILITY_DEFAULT; |
|
| 41 | 41 | |
| 42 | - /** @var int allowed visibilities */ |
|
| 43 | - protected $allowedVisibility = BackendService::VISIBILITY_DEFAULT; |
|
| 42 | + /** @var int allowed visibilities */ |
|
| 43 | + protected $allowedVisibility = BackendService::VISIBILITY_DEFAULT; |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * @return int |
|
| 47 | - */ |
|
| 48 | - public function getVisibility() { |
|
| 49 | - return $this->visibility; |
|
| 50 | - } |
|
| 45 | + /** |
|
| 46 | + * @return int |
|
| 47 | + */ |
|
| 48 | + public function getVisibility() { |
|
| 49 | + return $this->visibility; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Check if the backend is visible for a user type |
|
| 54 | - * |
|
| 55 | - * @param int $visibility |
|
| 56 | - * @return bool |
|
| 57 | - */ |
|
| 58 | - public function isVisibleFor($visibility) { |
|
| 59 | - if ($this->visibility & $visibility) { |
|
| 60 | - return true; |
|
| 61 | - } |
|
| 62 | - return false; |
|
| 63 | - } |
|
| 52 | + /** |
|
| 53 | + * Check if the backend is visible for a user type |
|
| 54 | + * |
|
| 55 | + * @param int $visibility |
|
| 56 | + * @return bool |
|
| 57 | + */ |
|
| 58 | + public function isVisibleFor($visibility) { |
|
| 59 | + if ($this->visibility & $visibility) { |
|
| 60 | + return true; |
|
| 61 | + } |
|
| 62 | + return false; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * @param int $visibility |
|
| 67 | - * @return self |
|
| 68 | - */ |
|
| 69 | - public function setVisibility($visibility) { |
|
| 70 | - $this->visibility = $visibility; |
|
| 71 | - $this->allowedVisibility |= $visibility; |
|
| 72 | - return $this; |
|
| 73 | - } |
|
| 65 | + /** |
|
| 66 | + * @param int $visibility |
|
| 67 | + * @return self |
|
| 68 | + */ |
|
| 69 | + public function setVisibility($visibility) { |
|
| 70 | + $this->visibility = $visibility; |
|
| 71 | + $this->allowedVisibility |= $visibility; |
|
| 72 | + return $this; |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * @param int $visibility |
|
| 77 | - * @return self |
|
| 78 | - */ |
|
| 79 | - public function addVisibility($visibility) { |
|
| 80 | - return $this->setVisibility($this->visibility | $visibility); |
|
| 81 | - } |
|
| 75 | + /** |
|
| 76 | + * @param int $visibility |
|
| 77 | + * @return self |
|
| 78 | + */ |
|
| 79 | + public function addVisibility($visibility) { |
|
| 80 | + return $this->setVisibility($this->visibility | $visibility); |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * @param int $visibility |
|
| 85 | - * @return self |
|
| 86 | - */ |
|
| 87 | - public function removeVisibility($visibility) { |
|
| 88 | - return $this->setVisibility($this->visibility & ~$visibility); |
|
| 89 | - } |
|
| 83 | + /** |
|
| 84 | + * @param int $visibility |
|
| 85 | + * @return self |
|
| 86 | + */ |
|
| 87 | + public function removeVisibility($visibility) { |
|
| 88 | + return $this->setVisibility($this->visibility & ~$visibility); |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * @return int |
|
| 93 | - */ |
|
| 94 | - public function getAllowedVisibility() { |
|
| 95 | - return $this->allowedVisibility; |
|
| 96 | - } |
|
| 91 | + /** |
|
| 92 | + * @return int |
|
| 93 | + */ |
|
| 94 | + public function getAllowedVisibility() { |
|
| 95 | + return $this->allowedVisibility; |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * Check if the backend is allowed to be visible for a user type |
|
| 100 | - * |
|
| 101 | - * @param int $allowedVisibility |
|
| 102 | - * @return bool |
|
| 103 | - */ |
|
| 104 | - public function isAllowedVisibleFor($allowedVisibility) { |
|
| 105 | - if ($this->allowedVisibility & $allowedVisibility) { |
|
| 106 | - return true; |
|
| 107 | - } |
|
| 108 | - return false; |
|
| 109 | - } |
|
| 98 | + /** |
|
| 99 | + * Check if the backend is allowed to be visible for a user type |
|
| 100 | + * |
|
| 101 | + * @param int $allowedVisibility |
|
| 102 | + * @return bool |
|
| 103 | + */ |
|
| 104 | + public function isAllowedVisibleFor($allowedVisibility) { |
|
| 105 | + if ($this->allowedVisibility & $allowedVisibility) { |
|
| 106 | + return true; |
|
| 107 | + } |
|
| 108 | + return false; |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - /** |
|
| 112 | - * @param int $allowedVisibility |
|
| 113 | - * @return self |
|
| 114 | - */ |
|
| 115 | - public function setAllowedVisibility($allowedVisibility) { |
|
| 116 | - $this->allowedVisibility = $allowedVisibility; |
|
| 117 | - $this->visibility &= $allowedVisibility; |
|
| 118 | - return $this; |
|
| 119 | - } |
|
| 111 | + /** |
|
| 112 | + * @param int $allowedVisibility |
|
| 113 | + * @return self |
|
| 114 | + */ |
|
| 115 | + public function setAllowedVisibility($allowedVisibility) { |
|
| 116 | + $this->allowedVisibility = $allowedVisibility; |
|
| 117 | + $this->visibility &= $allowedVisibility; |
|
| 118 | + return $this; |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | - /** |
|
| 122 | - * @param int $allowedVisibility |
|
| 123 | - * @return self |
|
| 124 | - */ |
|
| 125 | - public function addAllowedVisibility($allowedVisibility) { |
|
| 126 | - return $this->setAllowedVisibility($this->allowedVisibility | $allowedVisibility); |
|
| 127 | - } |
|
| 121 | + /** |
|
| 122 | + * @param int $allowedVisibility |
|
| 123 | + * @return self |
|
| 124 | + */ |
|
| 125 | + public function addAllowedVisibility($allowedVisibility) { |
|
| 126 | + return $this->setAllowedVisibility($this->allowedVisibility | $allowedVisibility); |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | - /** |
|
| 130 | - * @param int $allowedVisibility |
|
| 131 | - * @return self |
|
| 132 | - */ |
|
| 133 | - public function removeAllowedVisibility($allowedVisibility) { |
|
| 134 | - return $this->setAllowedVisibility($this->allowedVisibility & ~$allowedVisibility); |
|
| 135 | - } |
|
| 129 | + /** |
|
| 130 | + * @param int $allowedVisibility |
|
| 131 | + * @return self |
|
| 132 | + */ |
|
| 133 | + public function removeAllowedVisibility($allowedVisibility) { |
|
| 134 | + return $this->setAllowedVisibility($this->allowedVisibility & ~$allowedVisibility); |
|
| 135 | + } |
|
| 136 | 136 | } |
@@ -28,11 +28,11 @@ |
||
| 28 | 28 | * Builtin authentication mechanism, for legacy backends |
| 29 | 29 | */ |
| 30 | 30 | class Builtin extends AuthMechanism { |
| 31 | - public function __construct(IL10N $l) { |
|
| 32 | - $this |
|
| 33 | - ->setIdentifier('builtin::builtin') |
|
| 34 | - ->setScheme(self::SCHEME_BUILTIN) |
|
| 35 | - ->setText($l->t('Builtin')) |
|
| 36 | - ; |
|
| 37 | - } |
|
| 31 | + public function __construct(IL10N $l) { |
|
| 32 | + $this |
|
| 33 | + ->setIdentifier('builtin::builtin') |
|
| 34 | + ->setScheme(self::SCHEME_BUILTIN) |
|
| 35 | + ->setText($l->t('Builtin')) |
|
| 36 | + ; |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -28,11 +28,11 @@ |
||
| 28 | 28 | * Null authentication mechanism |
| 29 | 29 | */ |
| 30 | 30 | class NullMechanism extends AuthMechanism { |
| 31 | - public function __construct(IL10N $l) { |
|
| 32 | - $this |
|
| 33 | - ->setIdentifier('null::null') |
|
| 34 | - ->setScheme(self::SCHEME_NULL) |
|
| 35 | - ->setText($l->t('None')) |
|
| 36 | - ; |
|
| 37 | - } |
|
| 31 | + public function __construct(IL10N $l) { |
|
| 32 | + $this |
|
| 33 | + ->setIdentifier('null::null') |
|
| 34 | + ->setScheme(self::SCHEME_NULL) |
|
| 35 | + ->setText($l->t('None')) |
|
| 36 | + ; |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -27,18 +27,18 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | class InvalidAuth extends AuthMechanism { |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Constructs a new InvalidAuth with the id of the invalid auth |
|
| 32 | - * for display purposes |
|
| 33 | - * |
|
| 34 | - * @param string $invalidId invalid id |
|
| 35 | - */ |
|
| 36 | - public function __construct($invalidId) { |
|
| 37 | - $this |
|
| 38 | - ->setIdentifier($invalidId) |
|
| 39 | - ->setScheme(self::SCHEME_NULL) |
|
| 40 | - ->setText('Unknown auth mechanism backend ' . $invalidId) |
|
| 41 | - ; |
|
| 42 | - } |
|
| 30 | + /** |
|
| 31 | + * Constructs a new InvalidAuth with the id of the invalid auth |
|
| 32 | + * for display purposes |
|
| 33 | + * |
|
| 34 | + * @param string $invalidId invalid id |
|
| 35 | + */ |
|
| 36 | + public function __construct($invalidId) { |
|
| 37 | + $this |
|
| 38 | + ->setIdentifier($invalidId) |
|
| 39 | + ->setScheme(self::SCHEME_NULL) |
|
| 40 | + ->setText('Unknown auth mechanism backend ' . $invalidId) |
|
| 41 | + ; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | } |
@@ -30,13 +30,13 @@ |
||
| 30 | 30 | * @since 13.0.0 |
| 31 | 31 | */ |
| 32 | 32 | interface ISearchPlugin { |
| 33 | - /** |
|
| 34 | - * @param string $search |
|
| 35 | - * @param int $limit |
|
| 36 | - * @param int $offset |
|
| 37 | - * @param ISearchResult $searchResult |
|
| 38 | - * @return bool whether the plugin has more results |
|
| 39 | - * @since 13.0.0 |
|
| 40 | - */ |
|
| 41 | - public function search($search, $limit, $offset, ISearchResult $searchResult); |
|
| 33 | + /** |
|
| 34 | + * @param string $search |
|
| 35 | + * @param int $limit |
|
| 36 | + * @param int $offset |
|
| 37 | + * @param ISearchResult $searchResult |
|
| 38 | + * @return bool whether the plugin has more results |
|
| 39 | + * @since 13.0.0 |
|
| 40 | + */ |
|
| 41 | + public function search($search, $limit, $offset, ISearchResult $searchResult); |
|
| 42 | 42 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @package OC\AppFramework\Middleware\Security\Exceptions |
| 33 | 33 | */ |
| 34 | 34 | class LaxSameSiteCookieFailedException extends SecurityException { |
| 35 | - public function __construct() { |
|
| 36 | - parent::__construct('Lax Same Site Cookie is invalid in request.', Http::STATUS_PRECONDITION_FAILED); |
|
| 37 | - } |
|
| 35 | + public function __construct() { |
|
| 36 | + parent::__construct('Lax Same Site Cookie is invalid in request.', Http::STATUS_PRECONDITION_FAILED); |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -25,31 +25,31 @@ |
||
| 25 | 25 | use OCP\Remote\ICredentials; |
| 26 | 26 | |
| 27 | 27 | class Credentials implements ICredentials { |
| 28 | - /** @var string */ |
|
| 29 | - private $user; |
|
| 30 | - /** @var string */ |
|
| 31 | - private $password; |
|
| 28 | + /** @var string */ |
|
| 29 | + private $user; |
|
| 30 | + /** @var string */ |
|
| 31 | + private $password; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @param string $user |
|
| 35 | - * @param string $password |
|
| 36 | - */ |
|
| 37 | - public function __construct($user, $password) { |
|
| 38 | - $this->user = $user; |
|
| 39 | - $this->password = $password; |
|
| 40 | - } |
|
| 33 | + /** |
|
| 34 | + * @param string $user |
|
| 35 | + * @param string $password |
|
| 36 | + */ |
|
| 37 | + public function __construct($user, $password) { |
|
| 38 | + $this->user = $user; |
|
| 39 | + $this->password = $password; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @return string |
|
| 44 | - */ |
|
| 45 | - public function getUsername() { |
|
| 46 | - return $this->user; |
|
| 47 | - } |
|
| 42 | + /** |
|
| 43 | + * @return string |
|
| 44 | + */ |
|
| 45 | + public function getUsername() { |
|
| 46 | + return $this->user; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @return string |
|
| 51 | - */ |
|
| 52 | - public function getPassword() { |
|
| 53 | - return $this->password; |
|
| 54 | - } |
|
| 49 | + /** |
|
| 50 | + * @return string |
|
| 51 | + */ |
|
| 52 | + public function getPassword() { |
|
| 53 | + return $this->password; |
|
| 54 | + } |
|
| 55 | 55 | } |
@@ -28,14 +28,14 @@ |
||
| 28 | 28 | use OCP\Remote\IInstance; |
| 29 | 29 | |
| 30 | 30 | class ApiFactory implements IApiFactory { |
| 31 | - /** @var IClientService */ |
|
| 32 | - private $clientService; |
|
| 31 | + /** @var IClientService */ |
|
| 32 | + private $clientService; |
|
| 33 | 33 | |
| 34 | - public function __construct(IClientService $clientService) { |
|
| 35 | - $this->clientService = $clientService; |
|
| 36 | - } |
|
| 34 | + public function __construct(IClientService $clientService) { |
|
| 35 | + $this->clientService = $clientService; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - public function getApiCollection(IInstance $instance, ICredentials $credentials) { |
|
| 39 | - return new ApiCollection($instance, $credentials, $this->clientService); |
|
| 40 | - } |
|
| 38 | + public function getApiCollection(IInstance $instance, ICredentials $credentials) { |
|
| 39 | + return new ApiCollection($instance, $credentials, $this->clientService); |
|
| 40 | + } |
|
| 41 | 41 | } |
@@ -28,24 +28,24 @@ |
||
| 28 | 28 | use OCP\Remote\IInstance; |
| 29 | 29 | |
| 30 | 30 | class ApiCollection implements IApiCollection { |
| 31 | - /** @var IInstance */ |
|
| 32 | - private $instance; |
|
| 33 | - /** @var ICredentials */ |
|
| 34 | - private $credentials; |
|
| 35 | - /** @var IClientService */ |
|
| 36 | - private $clientService; |
|
| 31 | + /** @var IInstance */ |
|
| 32 | + private $instance; |
|
| 33 | + /** @var ICredentials */ |
|
| 34 | + private $credentials; |
|
| 35 | + /** @var IClientService */ |
|
| 36 | + private $clientService; |
|
| 37 | 37 | |
| 38 | - public function __construct(IInstance $instance, ICredentials $credentials, IClientService $clientService) { |
|
| 39 | - $this->instance = $instance; |
|
| 40 | - $this->credentials = $credentials; |
|
| 41 | - $this->clientService = $clientService; |
|
| 42 | - } |
|
| 38 | + public function __construct(IInstance $instance, ICredentials $credentials, IClientService $clientService) { |
|
| 39 | + $this->instance = $instance; |
|
| 40 | + $this->credentials = $credentials; |
|
| 41 | + $this->clientService = $clientService; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - public function getCapabilitiesApi() { |
|
| 45 | - return new OCS($this->instance, $this->credentials, $this->clientService); |
|
| 46 | - } |
|
| 44 | + public function getCapabilitiesApi() { |
|
| 45 | + return new OCS($this->instance, $this->credentials, $this->clientService); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - public function getUserApi() { |
|
| 49 | - return new OCS($this->instance, $this->credentials, $this->clientService); |
|
| 50 | - } |
|
| 48 | + public function getUserApi() { |
|
| 49 | + return new OCS($this->instance, $this->credentials, $this->clientService); |
|
| 50 | + } |
|
| 51 | 51 | } |