Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/user_ldap/lib/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public function writeToCache($key, $value, ?int $ttlOverride = null): void {
}
$key = $this->getCacheKey($key);
$value = base64_encode(json_encode($value));
$ttl = $ttlOverride ?? $this->configuration->ldapCacheTTL;
$ttl = $ttlOverride ?? (int) $this->configuration->ldapCacheTTL;
$this->cache->set($key, $value, $ttl);
}

Expand Down
4 changes: 1 addition & 3 deletions lib/public/Accounts/PropertyDoesNotExistException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
*/
class PropertyDoesNotExistException extends \Exception {
/**
* Constructor
* @param string $msg the error message
* @since 15.0.0
*/
public function __construct($property) {
public function __construct(string $property) {
parent::__construct('Property ' . $property . ' does not exist.');
}
}
2 changes: 1 addition & 1 deletion lib/public/Activity/IEventMerger.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ interface IEventMerger {
* @return IEvent
* @since 11.0
*/
public function mergeEvents($mergeParameter, IEvent $event, ?IEvent $previousEvent = null);
public function mergeEvents(string $mergeParameter, IEvent $event, ?IEvent $previousEvent = null);
}
2 changes: 1 addition & 1 deletion lib/public/Activity/IProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ interface IProvider {
* when they did not handle the event. Throwing \InvalidArgumentException directly is deprecated and will
* be logged as an error in Nextcloud 39.
*/
public function parse($language, IEvent $event, ?IEvent $previousEvent = null);
public function parse(string $language, IEvent $event, ?IEvent $previousEvent = null);
}
18 changes: 8 additions & 10 deletions lib/public/App/IAppManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ interface IAppManager {
/**
* Returns the app information from "appinfo/info.xml" for an app
*
* @param string|null $lang
* @return array|null
* @since 14.0.0
* @since 31.0.0 Usage of $path is discontinued and throws an \InvalidArgumentException, use {@see self::getAppInfoByPath} instead.
*/
public function getAppInfo(string $appId, bool $path = false, $lang = null);
public function getAppInfo(string $appId, bool $path = false, ?string $lang = null);

/**
* Returns the app information from a given path ending with "/appinfo/info.xml"
Expand Down Expand Up @@ -72,12 +71,11 @@ public function getAppIcon(string $appId, bool $dark = false): ?string;
/**
* Check if an app is enabled for user
*
* @param string $appId
* @param \OCP\IUser|null $user (optional) if not defined, the currently loggedin user will be used
* @param IUser|null $user (optional) if not defined, the currently loggedin user will be used
* @return bool
* @since 8.0.0
*/
public function isEnabledForUser($appId, $user = null);
public function isEnabledForUser(string $appId, ?IUser $user = null);

/**
* Check if an app is enabled in the instance
Expand All @@ -89,7 +87,7 @@ public function isEnabledForUser($appId, $user = null);
* @since 8.0.0
* @deprecated 32.0.0 Use either {@see self::isEnabledForUser} or {@see self::isEnabledForAnyone}
*/
public function isInstalled($appId);
public function isInstalled(string $appId);

/**
* Check if an app is enabled in the instance, either for everyone or for specific groups
Expand Down Expand Up @@ -140,7 +138,7 @@ public function enableApp(string $appId, bool $forceEnable = false): void;
* @return bool
* @since 12.0.0
*/
public function hasProtectedAppType($types);
public function hasProtectedAppType(array $types);

/**
* Enable an app only for specific groups
Expand All @@ -160,7 +158,7 @@ public function enableAppForGroups(string $appId, array $groups, bool $forceEnab
* @param bool $automaticDisabled
* @since 8.0.0
*/
public function disableApp($appId, $automaticDisabled = false): void;
public function disableApp(string $appId, bool $automaticDisabled = false): void;

/**
* Get the directory for the given app.
Expand All @@ -183,7 +181,7 @@ public function getAppWebPath(string $appId): string;
/**
* List all apps enabled for a user
*
* @param \OCP\IUser $user
* @param IUser $user
* @return list<string>
* @since 8.1.0
*/
Expand Down Expand Up @@ -217,7 +215,7 @@ public function clearAppsCache(): void;
* @return boolean
* @since 9.0.0
*/
public function isShipped($appId);
public function isShipped(string $appId);

/**
* Loads all apps
Expand Down
4 changes: 1 addition & 3 deletions lib/public/App/ManagerEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ class ManagerEvent extends Event {
/**
* DispatcherEvent constructor.
*
* @param string $event
* @param $appID
* @param \OCP\IGroup[]|null $groups
* @since 9.0.0
*/
public function __construct($event, $appID, ?array $groups = null) {
public function __construct(string $event, string $appID, ?array $groups = null) {
$this->event = $event;
$this->appID = $appID;
$this->groups = $groups;
Expand Down
10 changes: 6 additions & 4 deletions lib/public/AppFramework/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ abstract class ApiController extends Controller {
* request should be cached, defaults to 1728000 seconds
* @since 7.0.0
*/
public function __construct($appName,
public function __construct(
string $appName,
IRequest $request,
$corsMethods = 'PUT, POST, GET, DELETE, PATCH',
$corsAllowedHeaders = 'Authorization, Content-Type, Accept',
$corsMaxAge = 1728000) {
string $corsMethods = 'PUT, POST, GET, DELETE, PATCH',
string $corsAllowedHeaders = 'Authorization, Content-Type, Accept',
int $corsMaxAge = 1728000,
) {
parent::__construct($appName, $request);
$this->corsMethods = $corsMethods;
$this->corsAllowedHeaders = $corsAllowedHeaders;
Expand Down
6 changes: 4 additions & 2 deletions lib/public/AppFramework/AuthPublicShareController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ abstract class AuthPublicShareController extends PublicShareController {
/**
* @since 14.0.0
*/
public function __construct(string $appName,
public function __construct(
string $appName,
IRequest $request,
ISession $session,
IURLGenerator $urlGenerator) {
IURLGenerator $urlGenerator,
) {
parent::__construct($appName, $request, $session);

$this->urlGenerator = $urlGenerator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function registerServiceAlias(string $alias, string $target): void;
*
* @since 20.0.0
*/
public function registerParameter(string $name, $value): void;
public function registerParameter(string $name, mixed $value): void;

/**
* Register a service listener
Expand Down
12 changes: 7 additions & 5 deletions lib/public/AppFramework/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ abstract class Controller {
* @param IRequest $request an instance of the request
* @since 6.0.0 - parameter $appName was added in 7.0.0 - parameter $app was removed in 7.0.0
*/
public function __construct($appName,
IRequest $request) {
public function __construct(
string $appName,
IRequest $request,
) {
$this->appName = $appName;
$this->request = $request;

Expand Down Expand Up @@ -90,7 +92,7 @@ public function __construct($appName,
* @since 7.0.0
* @since 9.1.0 Added default parameter
*/
public function getResponderByHTTPHeader($acceptHeader, $default = 'json') {
public function getResponderByHTTPHeader(string $acceptHeader, string $default = 'json') {
$headers = explode(',', $acceptHeader);

// return the first matching responder
Expand All @@ -115,7 +117,7 @@ public function getResponderByHTTPHeader($acceptHeader, $default = 'json') {
* @param \Closure $responder
* @since 7.0.0
*/
protected function registerResponder($format, \Closure $responder) {
protected function registerResponder(string $format, \Closure $responder) {
$this->responders[$format] = $responder;
}

Expand All @@ -129,7 +131,7 @@ protected function registerResponder($format, \Closure $responder) {
* @return Response
* @since 7.0.0
*/
public function buildResponse($response, $format = 'json') {
public function buildResponse($response, string $format = 'json') {
if (array_key_exists($format, $this->responders)) {
$responder = $this->responders[$format];

Expand Down
4 changes: 1 addition & 3 deletions lib/public/AppFramework/Db/DoesNotExistException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
*/
class DoesNotExistException extends \Exception implements IMapperException {
/**
* Constructor
* @param string $msg the error message
* @since 7.0.0
*/
public function __construct($msg) {
public function __construct(string $msg) {
parent::__construct($msg);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
*/
class MultipleObjectsReturnedException extends \Exception implements IMapperException {
/**
* Constructor
* @param string $msg the error message
* @since 7.0.0
*/
public function __construct($msg) {
public function __construct(string $msg) {
parent::__construct($msg);
}
}
2 changes: 1 addition & 1 deletion lib/public/AppFramework/Http/DataDownloadResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(string $data, string $filename, string $contentType,
* @param string $data
* @since 8.0.0
*/
public function setData($data) {
public function setData(string $data) {
$this->data = $data;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/public/AppFramework/Http/DataResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(mixed $data = [], int $statusCode = Http::STATUS_OK,
* @return DataResponse Reference to this object
* @since 8.0.0
*/
public function setData($data) {
public function setData(mixed $data) {
$this->data = $data;

return $this;
Expand Down
Loading
Loading