mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
chore: add missing Override attribute to OC
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
81752fc9ed
commit
e0ba4d71b6
579 changed files with 3954 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ class Account implements IAccount {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setProperty(string $property, string $value, string $scope, string $verified, string $verificationData = ''): IAccount {
|
||||
if ($this->isCollection($property)) {
|
||||
throw new \InvalidArgumentException('setProperty cannot set an IAccountsPropertyCollection');
|
||||
|
|
@ -35,6 +36,7 @@ class Account implements IAccount {
|
|||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getProperty(string $property): IAccountProperty {
|
||||
if ($this->isCollection($property)) {
|
||||
throw new \InvalidArgumentException('getProperty cannot retrieve an IAccountsPropertyCollection');
|
||||
|
|
@ -45,12 +47,14 @@ class Account implements IAccount {
|
|||
return $this->properties[$property];
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getProperties(): array {
|
||||
return array_filter($this->properties, function ($obj) {
|
||||
return $obj instanceof IAccountProperty;
|
||||
});
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setAllPropertiesFromJson(array $properties): IAccount {
|
||||
foreach ($properties as $propertyName => $propertyObject) {
|
||||
if ($this->isCollection($propertyName)) {
|
||||
|
|
@ -73,6 +77,7 @@ class Account implements IAccount {
|
|||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAllProperties(): Generator {
|
||||
foreach ($this->properties as $propertyObject) {
|
||||
if ($propertyObject instanceof IAccountProperty) {
|
||||
|
|
@ -85,6 +90,7 @@ class Account implements IAccount {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getFilteredProperties(?string $scope = null, ?string $verified = null): array {
|
||||
$result = $incrementals = [];
|
||||
/** @var IAccountProperty $obj */
|
||||
|
|
@ -106,6 +112,7 @@ class Account implements IAccount {
|
|||
}
|
||||
|
||||
/** @return array<string, IAccountProperty|array<int, IAccountProperty>> */
|
||||
#[\Override]
|
||||
public function jsonSerialize(): array {
|
||||
$properties = $this->properties;
|
||||
foreach ($properties as $propertyName => $propertyObject) {
|
||||
|
|
@ -117,15 +124,18 @@ class Account implements IAccount {
|
|||
return $properties;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getUser(): IUser {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setPropertyCollection(IAccountPropertyCollection $propertyCollection): IAccount {
|
||||
$this->properties[$propertyCollection->getName()] = $propertyCollection;
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getPropertyCollection(string $propertyCollectionName): IAccountPropertyCollection {
|
||||
if (!$this->isCollection($propertyCollectionName)) {
|
||||
throw new PropertyDoesNotExistException($propertyCollectionName);
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@ class AccountManager implements IAccountManager {
|
|||
return $this->addMissingDefaultValues($userDataArray, $this->buildDefaultUserRecord($user));
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function searchUsers(string $property, array $values): array {
|
||||
// the value col is limited to 255 bytes. It is used for searches only.
|
||||
$values = array_map(function (string $value) {
|
||||
|
|
@ -655,6 +656,7 @@ class AccountManager implements IAccountManager {
|
|||
return $account;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAccount(IUser $user): IAccount {
|
||||
$cached = $this->internalCache->get($user->getUID());
|
||||
if ($cached !== null) {
|
||||
|
|
@ -826,6 +828,7 @@ class AccountManager implements IAccountManager {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function updateAccount(IAccount $account): void {
|
||||
$this->testValueLengths(iterator_to_array($account->getAllProperties()), true);
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class AccountProperty implements IAccountProperty {
|
|||
$this->setScope($scope);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function jsonSerialize(): array {
|
||||
return [
|
||||
'name' => $this->getName(),
|
||||
|
|
@ -44,6 +45,7 @@ class AccountProperty implements IAccountProperty {
|
|||
*
|
||||
* @since 15.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function setValue(string $value): IAccountProperty {
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
|
|
@ -54,6 +56,7 @@ class AccountProperty implements IAccountProperty {
|
|||
*
|
||||
* @since 15.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function setScope(string $scope): IAccountProperty {
|
||||
$newScope = $this->mapScopeToV2($scope);
|
||||
if (!in_array($newScope, [
|
||||
|
|
@ -73,6 +76,7 @@ class AccountProperty implements IAccountProperty {
|
|||
*
|
||||
* @since 15.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function setVerified(string $verified): IAccountProperty {
|
||||
$this->verified = $verified;
|
||||
return $this;
|
||||
|
|
@ -83,6 +87,7 @@ class AccountProperty implements IAccountProperty {
|
|||
*
|
||||
* @since 15.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getName(): string {
|
||||
return $this->name;
|
||||
}
|
||||
|
|
@ -92,6 +97,7 @@ class AccountProperty implements IAccountProperty {
|
|||
*
|
||||
* @since 15.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getValue(): string {
|
||||
return $this->value;
|
||||
}
|
||||
|
|
@ -101,6 +107,7 @@ class AccountProperty implements IAccountProperty {
|
|||
*
|
||||
* @since 15.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getScope(): string {
|
||||
return $this->scope;
|
||||
}
|
||||
|
|
@ -123,19 +130,23 @@ class AccountProperty implements IAccountProperty {
|
|||
*
|
||||
* @since 15.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getVerified(): string {
|
||||
return $this->verified;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setVerificationData(string $verificationData): IAccountProperty {
|
||||
$this->verificationData = $verificationData;
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getVerificationData(): string {
|
||||
return $this->verificationData;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setLocallyVerified(string $verified): IAccountProperty {
|
||||
if (!in_array($verified, [
|
||||
IAccountManager::NOT_VERIFIED,
|
||||
|
|
@ -148,6 +159,7 @@ class AccountProperty implements IAccountProperty {
|
|||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getLocallyVerified(): string {
|
||||
return $this->locallyVerified;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class AccountPropertyCollection implements IAccountPropertyCollection {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setProperties(array $properties): IAccountPropertyCollection {
|
||||
/** @var IAccountProperty $property */
|
||||
$this->properties = [];
|
||||
|
|
@ -30,10 +31,12 @@ class AccountPropertyCollection implements IAccountPropertyCollection {
|
|||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getProperties(): array {
|
||||
return $this->properties;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function addProperty(IAccountProperty $property): IAccountPropertyCollection {
|
||||
if ($property->getName() !== $this->collectionName) {
|
||||
throw new InvalidArgumentException('Provided property does not match collection name');
|
||||
|
|
@ -42,6 +45,7 @@ class AccountPropertyCollection implements IAccountPropertyCollection {
|
|||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function addPropertyWithDefaults(string $value): IAccountPropertyCollection {
|
||||
$property = new AccountProperty(
|
||||
$this->collectionName,
|
||||
|
|
@ -54,6 +58,7 @@ class AccountPropertyCollection implements IAccountPropertyCollection {
|
|||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function removeProperty(IAccountProperty $property): IAccountPropertyCollection {
|
||||
$ref = array_search($property, $this->properties, true);
|
||||
if ($ref !== false) {
|
||||
|
|
@ -62,6 +67,7 @@ class AccountPropertyCollection implements IAccountPropertyCollection {
|
|||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getPropertyByValue(string $value): ?IAccountProperty {
|
||||
foreach ($this->properties as $i => $property) {
|
||||
if ($property->getValue() === $value) {
|
||||
|
|
@ -71,6 +77,7 @@ class AccountPropertyCollection implements IAccountPropertyCollection {
|
|||
return null;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function removePropertyByValue(string $value): IAccountPropertyCollection {
|
||||
foreach ($this->properties as $i => $property) {
|
||||
if ($property->getValue() === $value) {
|
||||
|
|
@ -80,10 +87,12 @@ class AccountPropertyCollection implements IAccountPropertyCollection {
|
|||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function jsonSerialize(): array {
|
||||
return [$this->collectionName => $this->properties];
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getName(): string {
|
||||
return $this->collectionName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class Hooks implements IEventListener {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if (!$event instanceof UserChangedEvent) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -23,30 +23,37 @@ class ActivitySettingsAdapter extends ActivitySettings {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getIdentifier() {
|
||||
return $this->oldSettings->getIdentifier();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getName() {
|
||||
return $this->oldSettings->getName();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getGroupIdentifier() {
|
||||
return 'other';
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getGroupName() {
|
||||
return $this->l10n->t('Other activities');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getPriority() {
|
||||
return $this->oldSettings->getPriority();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function canChangeMail() {
|
||||
return $this->oldSettings->canChangeMail();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function isDefaultEnabledMail() {
|
||||
return $this->oldSettings->isDefaultEnabledMail();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setApp(string $app): IEvent {
|
||||
if ($app === '' || isset($app[32])) {
|
||||
throw new InvalidValueException('app');
|
||||
|
|
@ -81,6 +82,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getApp(): string {
|
||||
return $this->app;
|
||||
}
|
||||
|
|
@ -88,6 +90,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setType(string $type): IEvent {
|
||||
if ($type === '' || isset($type[255])) {
|
||||
throw new InvalidValueException('type');
|
||||
|
|
@ -99,6 +102,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getType(): string {
|
||||
return $this->type;
|
||||
}
|
||||
|
|
@ -106,6 +110,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setAffectedUser(string $affectedUser): IEvent {
|
||||
if ($affectedUser === '' || isset($affectedUser[64])) {
|
||||
throw new InvalidValueException('affectedUser');
|
||||
|
|
@ -117,6 +122,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAffectedUser(): string {
|
||||
return $this->affectedUser;
|
||||
}
|
||||
|
|
@ -124,6 +130,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setAuthor(string $author): IEvent {
|
||||
if (isset($author[64])) {
|
||||
throw new InvalidValueException('author');
|
||||
|
|
@ -135,6 +142,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAuthor(): string {
|
||||
return $this->author;
|
||||
}
|
||||
|
|
@ -142,6 +150,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setTimestamp(int $timestamp): IEvent {
|
||||
if ($timestamp < 0) {
|
||||
throw new InvalidValueException('timestamp');
|
||||
|
|
@ -153,6 +162,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return int
|
||||
*/
|
||||
#[\Override]
|
||||
public function getTimestamp(): int {
|
||||
return $this->timestamp;
|
||||
}
|
||||
|
|
@ -160,6 +170,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setSubject(string $subject, array $parameters = []): IEvent {
|
||||
if (isset($subject[255])) {
|
||||
throw new InvalidValueException('subject');
|
||||
|
|
@ -172,6 +183,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getSubject(): string {
|
||||
return $this->subject;
|
||||
}
|
||||
|
|
@ -179,6 +191,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return array
|
||||
*/
|
||||
#[\Override]
|
||||
public function getSubjectParameters(): array {
|
||||
return $this->subjectParameters;
|
||||
}
|
||||
|
|
@ -186,6 +199,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setParsedSubject(string $subject): IEvent {
|
||||
if ($subject === '') {
|
||||
throw new InvalidValueException('parsedSubject');
|
||||
|
|
@ -198,6 +212,7 @@ class Event implements IEvent {
|
|||
* @return string
|
||||
* @since 11.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getParsedSubject(): string {
|
||||
return $this->subjectParsed;
|
||||
}
|
||||
|
|
@ -205,6 +220,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setRichSubject(string $subject, array $parameters = []): IEvent {
|
||||
if ($subject === '') {
|
||||
throw new InvalidValueException('richSubject');
|
||||
|
|
@ -227,6 +243,7 @@ class Event implements IEvent {
|
|||
* @return string
|
||||
* @since 11.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getRichSubject(): string {
|
||||
return $this->subjectRich;
|
||||
}
|
||||
|
|
@ -235,6 +252,7 @@ class Event implements IEvent {
|
|||
* @return array<string, array<string, string>>
|
||||
* @since 11.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getRichSubjectParameters(): array {
|
||||
return $this->subjectRichParameters;
|
||||
}
|
||||
|
|
@ -242,6 +260,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setMessage(string $message, array $parameters = []): IEvent {
|
||||
if (isset($message[255])) {
|
||||
throw new InvalidValueException('message');
|
||||
|
|
@ -254,6 +273,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getMessage(): string {
|
||||
return $this->message;
|
||||
}
|
||||
|
|
@ -261,6 +281,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return array
|
||||
*/
|
||||
#[\Override]
|
||||
public function getMessageParameters(): array {
|
||||
return $this->messageParameters;
|
||||
}
|
||||
|
|
@ -268,6 +289,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setParsedMessage(string $message): IEvent {
|
||||
$this->messageParsed = $message;
|
||||
return $this;
|
||||
|
|
@ -277,6 +299,7 @@ class Event implements IEvent {
|
|||
* @return string
|
||||
* @since 11.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getParsedMessage(): string {
|
||||
return $this->messageParsed;
|
||||
}
|
||||
|
|
@ -284,6 +307,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setRichMessage(string $message, array $parameters = []): IEvent {
|
||||
$this->messageRich = $message;
|
||||
$this->messageRichParameters = $parameters;
|
||||
|
|
@ -303,6 +327,7 @@ class Event implements IEvent {
|
|||
* @return string
|
||||
* @since 11.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getRichMessage(): string {
|
||||
return $this->messageRich;
|
||||
}
|
||||
|
|
@ -311,6 +336,7 @@ class Event implements IEvent {
|
|||
* @return array<string, array<string, string>>
|
||||
* @since 11.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getRichMessageParameters(): array {
|
||||
return $this->messageRichParameters;
|
||||
}
|
||||
|
|
@ -318,6 +344,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setObject(string $objectType, string|int $objectId, string $objectName = ''): IEvent {
|
||||
if (isset($objectType[255])) {
|
||||
throw new InvalidValueException('objectType');
|
||||
|
|
@ -337,6 +364,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getObjectType(): string {
|
||||
return $this->objectType;
|
||||
}
|
||||
|
|
@ -344,6 +372,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return int|string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getObjectId(): string|int {
|
||||
return $this->objectId;
|
||||
}
|
||||
|
|
@ -351,6 +380,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getObjectName(): string {
|
||||
return $this->objectName;
|
||||
}
|
||||
|
|
@ -358,6 +388,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setLink(string $link): IEvent {
|
||||
if (isset($link[4000])) {
|
||||
throw new InvalidValueException('link');
|
||||
|
|
@ -369,6 +400,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getLink(): string {
|
||||
return $this->link;
|
||||
}
|
||||
|
|
@ -376,6 +408,7 @@ class Event implements IEvent {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setIcon(string $icon): IEvent {
|
||||
if (isset($icon[4000])) {
|
||||
throw new InvalidValueException('icon');
|
||||
|
|
@ -388,6 +421,7 @@ class Event implements IEvent {
|
|||
* @return string
|
||||
* @since 11.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getIcon(): string {
|
||||
return $this->icon;
|
||||
}
|
||||
|
|
@ -397,6 +431,7 @@ class Event implements IEvent {
|
|||
* @return $this
|
||||
* @since 11.0.0 - Since 15.0.0 returns $this
|
||||
*/
|
||||
#[\Override]
|
||||
public function setChildEvent(IEvent $child): IEvent {
|
||||
$this->child = $child;
|
||||
return $this;
|
||||
|
|
@ -406,6 +441,7 @@ class Event implements IEvent {
|
|||
* @return IEvent|null
|
||||
* @since 11.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getChildEvent() {
|
||||
return $this->child;
|
||||
}
|
||||
|
|
@ -414,6 +450,7 @@ class Event implements IEvent {
|
|||
* @return bool
|
||||
* @since 8.2.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function isValid(): bool {
|
||||
return
|
||||
$this->isValidCommon()
|
||||
|
|
@ -425,6 +462,7 @@ class Event implements IEvent {
|
|||
* @return bool
|
||||
* @since 8.2.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function isValidParsed(): bool {
|
||||
if ($this->getRichSubject() !== '' || !empty($this->getRichSubjectParameters())) {
|
||||
try {
|
||||
|
|
@ -463,11 +501,13 @@ class Event implements IEvent {
|
|||
;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setGenerateNotification(bool $generate): IEvent {
|
||||
$this->generateNotification = $generate;
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getGenerateNotification(): bool {
|
||||
return $this->generateNotification;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ class EventMerger implements IEventMerger {
|
|||
* @param IEvent|null $previousEvent
|
||||
* @return IEvent
|
||||
*/
|
||||
#[\Override]
|
||||
public function mergeEvents($mergeParameter, IEvent $event, ?IEvent $previousEvent = null) {
|
||||
// No second event => can not combine
|
||||
if (!$previousEvent instanceof IEvent) {
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @return IEvent
|
||||
*/
|
||||
#[\Override]
|
||||
public function generateEvent(): IEvent {
|
||||
return new Event($this->validator, $this->richTextFormatter);
|
||||
}
|
||||
|
|
@ -99,6 +100,7 @@ class Manager implements IManager {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function publish(IEvent $event): void {
|
||||
if ($event->getAuthor() === '' && $this->session->getUser() instanceof IUser) {
|
||||
$event->setAuthor($this->session->getUser()->getUID());
|
||||
|
|
@ -120,6 +122,7 @@ class Manager implements IManager {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function bulkPublish(IEvent $event, array $affectedUserIds, ISetting $setting): void {
|
||||
if (empty($affectedUserIds)) {
|
||||
throw new IncompleteActivityException('The given event is invalid');
|
||||
|
|
@ -158,6 +161,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @param \Closure $callable
|
||||
*/
|
||||
#[\Override]
|
||||
public function registerConsumer(\Closure $callable): void {
|
||||
$this->consumersClosures[] = $callable;
|
||||
$this->consumers = [];
|
||||
|
|
@ -173,6 +177,7 @@ class Manager implements IManager {
|
|||
* @param string $filter Class must implement OCA\Activity\IFilter
|
||||
* @return void
|
||||
*/
|
||||
#[\Override]
|
||||
public function registerFilter(string $filter): void {
|
||||
$this->filterClasses[$filter] = false;
|
||||
}
|
||||
|
|
@ -181,6 +186,7 @@ class Manager implements IManager {
|
|||
* @return IFilter[]
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFilters(): array {
|
||||
foreach ($this->filterClasses as $class => $false) {
|
||||
/** @var IFilter $filter */
|
||||
|
|
@ -200,6 +206,7 @@ class Manager implements IManager {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFilterById(string $id): IFilter {
|
||||
$filters = $this->getFilters();
|
||||
|
||||
|
|
@ -220,6 +227,7 @@ class Manager implements IManager {
|
|||
* @param string $provider Class must implement OCA\Activity\IProvider
|
||||
* @return void
|
||||
*/
|
||||
#[\Override]
|
||||
public function registerProvider(string $provider): void {
|
||||
$this->providerClasses[$provider] = false;
|
||||
}
|
||||
|
|
@ -228,6 +236,7 @@ class Manager implements IManager {
|
|||
* @return IProvider[]
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
#[\Override]
|
||||
public function getProviders(): array {
|
||||
foreach ($this->providerClasses as $class => $false) {
|
||||
/** @var IProvider $provider */
|
||||
|
|
@ -254,6 +263,7 @@ class Manager implements IManager {
|
|||
* @param string $setting Class must implement OCA\Activity\ISetting
|
||||
* @return void
|
||||
*/
|
||||
#[\Override]
|
||||
public function registerSetting(string $setting): void {
|
||||
$this->settingsClasses[$setting] = false;
|
||||
}
|
||||
|
|
@ -262,6 +272,7 @@ class Manager implements IManager {
|
|||
* @return ActivitySettings[]
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
#[\Override]
|
||||
public function getSettings(): array {
|
||||
foreach ($this->settingsClasses as $class => $false) {
|
||||
/** @var ISetting $setting */
|
||||
|
|
@ -285,6 +296,7 @@ class Manager implements IManager {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getSettingById(string $id): ActivitySettings {
|
||||
$settings = $this->getSettings();
|
||||
|
||||
|
|
@ -300,6 +312,7 @@ class Manager implements IManager {
|
|||
* @param string $type
|
||||
* @param int|numeric-string $id
|
||||
*/
|
||||
#[\Override]
|
||||
public function setFormattingObject(string $type, int|string $id): void {
|
||||
$this->formattingObjectType = $type;
|
||||
$this->formattingObjectId = $id;
|
||||
|
|
@ -308,6 +321,7 @@ class Manager implements IManager {
|
|||
/**
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
public function isFormattingFilteredObject(): bool {
|
||||
return $this->formattingObjectType !== null && $this->formattingObjectId !== null
|
||||
&& $this->formattingObjectType === $this->request->getParam('object_type')
|
||||
|
|
@ -317,6 +331,7 @@ class Manager implements IManager {
|
|||
/**
|
||||
* @param bool $status Set to true, when parsing events should not use SVG icons
|
||||
*/
|
||||
#[\Override]
|
||||
public function setRequirePNG(bool $status): void {
|
||||
$this->requirePNG = $status;
|
||||
}
|
||||
|
|
@ -324,6 +339,7 @@ class Manager implements IManager {
|
|||
/**
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
public function getRequirePNG(): bool {
|
||||
return $this->requirePNG;
|
||||
}
|
||||
|
|
@ -333,6 +349,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @param string|null $currentUserId
|
||||
*/
|
||||
#[\Override]
|
||||
public function setCurrentUserId(?string $currentUserId = null): void {
|
||||
$this->currentUserId = $currentUserId;
|
||||
}
|
||||
|
|
@ -345,6 +362,7 @@ class Manager implements IManager {
|
|||
* @return string
|
||||
* @throws \UnexpectedValueException If the token is invalid, does not exist or is not unique
|
||||
*/
|
||||
#[\Override]
|
||||
public function getCurrentUserId(): string {
|
||||
if ($this->currentUserId !== null) {
|
||||
return $this->currentUserId;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class AllConfig implements IConfig {
|
|||
* @param array $configs Associative array with `key => value` pairs
|
||||
* If value is null, the config key will be deleted
|
||||
*/
|
||||
#[\Override]
|
||||
public function setSystemValues(array $configs) {
|
||||
$this->systemConfig->setValues($configs);
|
||||
}
|
||||
|
|
@ -40,6 +41,7 @@ class AllConfig implements IConfig {
|
|||
* @param string $key the key of the value, under which will be saved
|
||||
* @param mixed $value the value that should be stored
|
||||
*/
|
||||
#[\Override]
|
||||
public function setSystemValue($key, $value) {
|
||||
$this->systemConfig->setValue($key, $value);
|
||||
}
|
||||
|
|
@ -51,6 +53,7 @@ class AllConfig implements IConfig {
|
|||
* @param mixed $default the default value to be returned if the value isn't set
|
||||
* @return mixed the value or $default
|
||||
*/
|
||||
#[\Override]
|
||||
public function getSystemValue($key, $default = '') {
|
||||
return $this->systemConfig->getValue($key, $default);
|
||||
}
|
||||
|
|
@ -65,6 +68,7 @@ class AllConfig implements IConfig {
|
|||
*
|
||||
* @since 16.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getSystemValueBool(string $key, bool $default = false): bool {
|
||||
return (bool)$this->getSystemValue($key, $default);
|
||||
}
|
||||
|
|
@ -79,6 +83,7 @@ class AllConfig implements IConfig {
|
|||
*
|
||||
* @since 16.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getSystemValueInt(string $key, int $default = 0): int {
|
||||
return (int)$this->getSystemValue($key, $default);
|
||||
}
|
||||
|
|
@ -93,6 +98,7 @@ class AllConfig implements IConfig {
|
|||
*
|
||||
* @since 16.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getSystemValueString(string $key, string $default = ''): string {
|
||||
return (string)$this->getSystemValue($key, $default);
|
||||
}
|
||||
|
|
@ -104,6 +110,7 @@ class AllConfig implements IConfig {
|
|||
* @param mixed $default the default value to be returned if the value isn't set
|
||||
* @return mixed the value or $default
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFilteredSystemValue($key, $default = '') {
|
||||
return $this->systemConfig->getFilteredValue($key, $default);
|
||||
}
|
||||
|
|
@ -113,6 +120,7 @@ class AllConfig implements IConfig {
|
|||
*
|
||||
* @param string $key the key of the value, under which it was saved
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteSystemValue($key) {
|
||||
$this->systemConfig->deleteValue($key);
|
||||
}
|
||||
|
|
@ -124,6 +132,7 @@ class AllConfig implements IConfig {
|
|||
* @return string[] the keys stored for the app
|
||||
* @deprecated 29.0.0 Use {@see IAppConfig} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppKeys($appName) {
|
||||
return Server::get(AppConfig::class)->getKeys($appName);
|
||||
}
|
||||
|
|
@ -136,6 +145,7 @@ class AllConfig implements IConfig {
|
|||
* @param string|float|int $value the value that should be stored
|
||||
* @deprecated 29.0.0 Use {@see IAppConfig} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function setAppValue($appName, $key, $value) {
|
||||
Server::get(AppConfig::class)->setValue($appName, $key, $value);
|
||||
}
|
||||
|
|
@ -149,6 +159,7 @@ class AllConfig implements IConfig {
|
|||
* @return string the saved value
|
||||
* @deprecated 29.0.0 Use {@see IAppConfig} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppValue($appName, $key, $default = '') {
|
||||
return Server::get(AppConfig::class)->getValue($appName, $key, $default) ?? $default;
|
||||
}
|
||||
|
|
@ -160,6 +171,7 @@ class AllConfig implements IConfig {
|
|||
* @param string $key the key of the value, under which it was saved
|
||||
* @deprecated 29.0.0 Use {@see IAppConfig} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteAppValue($appName, $key) {
|
||||
Server::get(AppConfig::class)->deleteKey($appName, $key);
|
||||
}
|
||||
|
|
@ -170,6 +182,7 @@ class AllConfig implements IConfig {
|
|||
* @param string $appName the appName the configs are stored under
|
||||
* @deprecated 29.0.0 Use {@see IAppConfig} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteAppValues($appName) {
|
||||
Server::get(AppConfig::class)->deleteApp($appName);
|
||||
}
|
||||
|
|
@ -193,6 +206,7 @@ class AllConfig implements IConfig {
|
|||
* @see IUserConfig::getValueArray
|
||||
* @see IUserConfig::getValueBool
|
||||
*/
|
||||
#[\Override]
|
||||
public function setUserValue($userId, $appName, $key, $value, $preCondition = null) {
|
||||
if (!is_int($value) && !is_float($value) && !is_string($value)) {
|
||||
throw new \UnexpectedValueException('Only integers, floats and strings are allowed as value');
|
||||
|
|
@ -228,6 +242,7 @@ class AllConfig implements IConfig {
|
|||
* @see IUserConfig::getValueArray
|
||||
* @see IUserConfig::getValueBool
|
||||
*/
|
||||
#[\Override]
|
||||
public function getUserValue($userId, $appName, $key, $default = '') {
|
||||
if ($userId === null || $userId === '') {
|
||||
return $default;
|
||||
|
|
@ -250,6 +265,7 @@ class AllConfig implements IConfig {
|
|||
* @return string[]
|
||||
* @deprecated 31.0.0 - use {@see IUserConfig::getKeys} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function getUserKeys($userId, $appName) {
|
||||
return Server::get(IUserConfig::class)->getKeys($userId, $appName);
|
||||
}
|
||||
|
|
@ -263,6 +279,7 @@ class AllConfig implements IConfig {
|
|||
*
|
||||
* @deprecated 31.0.0 - use {@see IUserConfig::deleteUserConfig} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteUserValue($userId, $appName, $key) {
|
||||
Server::get(IUserConfig::class)->deleteUserConfig($userId, $appName, $key);
|
||||
}
|
||||
|
|
@ -274,6 +291,7 @@ class AllConfig implements IConfig {
|
|||
*
|
||||
* @deprecated 31.0.0 - use {@see IUserConfig::deleteAllUserConfig} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteAllUserValues($userId) {
|
||||
if ($userId === null) {
|
||||
return;
|
||||
|
|
@ -288,6 +306,7 @@ class AllConfig implements IConfig {
|
|||
*
|
||||
* @deprecated 31.0.0 - use {@see IUserConfig::deleteApp} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteAppFromAllUsers($appName) {
|
||||
Server::get(IUserConfig::class)->deleteApp($appName);
|
||||
}
|
||||
|
|
@ -304,6 +323,7 @@ class AllConfig implements IConfig {
|
|||
* ]
|
||||
* @deprecated 31.0.0 - use {@see IUserConfig::getAllValues} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAllUserValues(?string $userId): array {
|
||||
if ($userId === null || $userId === '') {
|
||||
return [];
|
||||
|
|
@ -329,6 +349,7 @@ class AllConfig implements IConfig {
|
|||
* @return array Mapped values: userId => value
|
||||
* @deprecated 31.0.0 - use {@see IUserConfig::getValuesByUsers} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function getUserValueForUsers($appName, $key, $userIds) {
|
||||
return Server::get(IUserConfig::class)->getValuesByUsers($appName, $key, ValueType::MIXED, $userIds);
|
||||
}
|
||||
|
|
@ -343,6 +364,7 @@ class AllConfig implements IConfig {
|
|||
* @return list<string> of user IDs
|
||||
* @deprecated 31.0.0 - use {@see IUserConfig::searchUsersByValueString} directly
|
||||
*/
|
||||
#[\Override]
|
||||
public function getUsersForUserValue($appName, $key, $value) {
|
||||
/** @var list<string> $result */
|
||||
$result = iterator_to_array(Server::get(IUserConfig::class)->searchUsersByValueString($appName, $key, $value));
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ class AppManager implements IAppManager {
|
|||
return $this->navigationManager;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAppIcon(string $appId, bool $dark = false): ?string {
|
||||
$possibleIcons = $dark ? [$appId . '-dark.svg', 'app-dark.svg'] : [$appId . '.svg', 'app.svg'];
|
||||
$icon = null;
|
||||
|
|
@ -168,6 +169,7 @@ class AppManager implements IAppManager {
|
|||
*
|
||||
* @return string[]
|
||||
*/
|
||||
#[\Override]
|
||||
public function getInstalledApps() {
|
||||
return $this->getEnabledApps();
|
||||
}
|
||||
|
|
@ -177,6 +179,7 @@ class AppManager implements IAppManager {
|
|||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function getEnabledApps(): array {
|
||||
return array_keys($this->getEnabledAppsValues());
|
||||
}
|
||||
|
|
@ -186,6 +189,7 @@ class AppManager implements IAppManager {
|
|||
*
|
||||
* @return list<string> an array of app names (string IDs)
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAllAppsInAppsFolders(): array {
|
||||
$apps = [];
|
||||
|
||||
|
|
@ -218,6 +222,7 @@ class AppManager implements IAppManager {
|
|||
* @param IUser $user
|
||||
* @return list<string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function getEnabledAppsForUser(IUser $user) {
|
||||
$apps = $this->getEnabledAppsValues();
|
||||
$appsForUser = array_filter($apps, function ($enabled) use ($user) {
|
||||
|
|
@ -226,6 +231,7 @@ class AppManager implements IAppManager {
|
|||
return array_keys($appsForUser);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getEnabledAppsForGroup(IGroup $group): array {
|
||||
$apps = $this->getEnabledAppsValues();
|
||||
$appsForGroups = array_filter($apps, function ($enabled) use ($group) {
|
||||
|
|
@ -246,6 +252,7 @@ class AppManager implements IAppManager {
|
|||
*
|
||||
* if $types is set to non-empty array, only apps of those types will be loaded
|
||||
*/
|
||||
#[\Override]
|
||||
public function loadApps(array $types = []): bool {
|
||||
if ($this->config->getSystemValueBool('maintenance', false)) {
|
||||
return false;
|
||||
|
|
@ -295,6 +302,7 @@ class AppManager implements IAppManager {
|
|||
* @param array $types
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
public function isType(string $app, array $types): bool {
|
||||
$appTypes = $this->getAppTypes($app);
|
||||
foreach ($types as $type) {
|
||||
|
|
@ -331,6 +339,7 @@ class AppManager implements IAppManager {
|
|||
return $this->autoDisabledApps;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAppRestriction(string $appId): array {
|
||||
$values = $this->getEnabledAppsValues();
|
||||
|
||||
|
|
@ -351,6 +360,7 @@ class AppManager implements IAppManager {
|
|||
* @param IUser|null $user (optional) if not defined, the currently logged in user will be used
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
public function isEnabledForUser($appId, $user = null) {
|
||||
if ($this->isAlwaysEnabled($appId)) {
|
||||
return true;
|
||||
|
|
@ -425,10 +435,12 @@ class AppManager implements IAppManager {
|
|||
*
|
||||
* @param string $appId
|
||||
*/
|
||||
#[\Override]
|
||||
public function isInstalled($appId): bool {
|
||||
return $this->isEnabledForAnyone($appId);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function isEnabledForAnyone(string $appId): bool {
|
||||
$enabledAppsValues = $this->getEnabledAppsValues();
|
||||
return isset($enabledAppsValues[$appId]);
|
||||
|
|
@ -455,6 +467,7 @@ class AppManager implements IAppManager {
|
|||
$this->config->setSystemValue('app_install_overwrite', $ignoreMaxApps);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function loadApp(string $app): void {
|
||||
if (isset($this->loadedApps[$app])) {
|
||||
return;
|
||||
|
|
@ -569,6 +582,7 @@ class AppManager implements IAppManager {
|
|||
* @param string $app app id
|
||||
* @since 26.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function isAppLoaded(string $app): bool {
|
||||
return isset($this->loadedApps[$app]);
|
||||
}
|
||||
|
|
@ -581,6 +595,7 @@ class AppManager implements IAppManager {
|
|||
* @throws AppPathNotFoundException
|
||||
* @throws \InvalidArgumentException if the application is not installed yet
|
||||
*/
|
||||
#[\Override]
|
||||
public function enableApp(string $appId, bool $forceEnable = false): void {
|
||||
// Check if app exists
|
||||
$this->getAppPath($appId);
|
||||
|
|
@ -610,6 +625,7 @@ class AppManager implements IAppManager {
|
|||
* @param string[] $types
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
public function hasProtectedAppType($types) {
|
||||
if (empty($types)) {
|
||||
return false;
|
||||
|
|
@ -628,6 +644,7 @@ class AppManager implements IAppManager {
|
|||
* @throws \InvalidArgumentException if app can't be enabled for groups
|
||||
* @throws AppPathNotFoundException
|
||||
*/
|
||||
#[\Override]
|
||||
public function enableAppForGroups(string $appId, array $groups, bool $forceEnable = false): void {
|
||||
// Check if app exists
|
||||
$this->getAppPath($appId);
|
||||
|
|
@ -671,6 +688,7 @@ class AppManager implements IAppManager {
|
|||
* @param bool $automaticDisabled
|
||||
* @throws \Exception if app can't be disabled
|
||||
*/
|
||||
#[\Override]
|
||||
public function disableApp($appId, $automaticDisabled = false): void {
|
||||
if ($this->isAlwaysEnabled($appId)) {
|
||||
throw new \Exception("$appId can't be disabled.");
|
||||
|
|
@ -707,6 +725,7 @@ class AppManager implements IAppManager {
|
|||
*
|
||||
* @throws AppPathNotFoundException if app folder can't be found
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppPath(string $appId, bool $ignoreCache = false): string {
|
||||
$appId = $this->cleanAppId($appId);
|
||||
if ($appId === '') {
|
||||
|
|
@ -726,6 +745,7 @@ class AppManager implements IAppManager {
|
|||
*
|
||||
* @throws AppPathNotFoundException if app path can't be found
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppWebPath(string $appId): string {
|
||||
if (($dir = $this->findAppInDirectories($appId)) != false) {
|
||||
return \OC::$WEBROOT . $dir['url'] . '/' . $appId;
|
||||
|
|
@ -787,6 +807,7 @@ class AppManager implements IAppManager {
|
|||
/**
|
||||
* Clear the cached list of apps when enabling/disabling an app
|
||||
*/
|
||||
#[\Override]
|
||||
public function clearAppsCache(): void {
|
||||
$this->appInfos = [];
|
||||
}
|
||||
|
|
@ -823,6 +844,7 @@ class AppManager implements IAppManager {
|
|||
* @param string|null $lang
|
||||
* @return array|null app info
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppInfo(string $appId, bool $path = false, $lang = null) {
|
||||
if ($path) {
|
||||
throw new \InvalidArgumentException('Calling IAppManager::getAppInfo() with a path is no longer supported. Please call IAppManager::getAppInfoByPath() instead and verify that the path is good before calling.');
|
||||
|
|
@ -846,6 +868,7 @@ class AppManager implements IAppManager {
|
|||
return $data;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAppInfoByPath(string $path, ?string $lang = null): ?array {
|
||||
if (!str_ends_with($path, '/appinfo/info.xml')) {
|
||||
return null;
|
||||
|
|
@ -861,6 +884,7 @@ class AppManager implements IAppManager {
|
|||
return $data;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAppVersion(string $appId, bool $useCache = true): string {
|
||||
if (!$useCache || !isset($this->appVersions[$appId])) {
|
||||
if ($appId === 'core') {
|
||||
|
|
@ -878,6 +902,7 @@ class AppManager implements IAppManager {
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppInstalledVersions(bool $onlyEnabled = false): array {
|
||||
return $this->getAppConfig()->getAppInstalledVersions($onlyEnabled);
|
||||
}
|
||||
|
|
@ -909,6 +934,7 @@ class AppManager implements IAppManager {
|
|||
* @inheritdoc
|
||||
* In case you change this method, also change \OC\App\CodeChecker\InfoChecker::isShipped()
|
||||
*/
|
||||
#[\Override]
|
||||
public function isShipped($appId) {
|
||||
$this->loadShippedJson();
|
||||
return in_array($appId, $this->shippedApps, true);
|
||||
|
|
@ -943,6 +969,7 @@ class AppManager implements IAppManager {
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAlwaysEnabledApps() {
|
||||
$this->loadShippedJson();
|
||||
return $this->alwaysEnabled;
|
||||
|
|
@ -951,6 +978,7 @@ class AppManager implements IAppManager {
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
#[\Override]
|
||||
public function isDefaultEnabled(string $appId): bool {
|
||||
return (in_array($appId, $this->getDefaultEnabledApps()));
|
||||
}
|
||||
|
|
@ -958,6 +986,7 @@ class AppManager implements IAppManager {
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
#[\Override]
|
||||
public function getDefaultEnabledApps(): array {
|
||||
$this->loadShippedJson();
|
||||
|
||||
|
|
@ -967,6 +996,7 @@ class AppManager implements IAppManager {
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
#[\Override]
|
||||
public function getDefaultAppForUser(?IUser $user = null, bool $withFallbacks = true): string {
|
||||
$id = $this->getNavigationManager()->getDefaultEntryIdForUser($user, $withFallbacks);
|
||||
$entry = $this->getNavigationManager()->get($id);
|
||||
|
|
@ -976,6 +1006,7 @@ class AppManager implements IAppManager {
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
#[\Override]
|
||||
public function getDefaultApps(): array {
|
||||
$ids = $this->getNavigationManager()->getDefaultEntryIds();
|
||||
|
||||
|
|
@ -988,6 +1019,7 @@ class AppManager implements IAppManager {
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
#[\Override]
|
||||
public function setDefaultApps(array $defaultApps): void {
|
||||
$entries = $this->getNavigationManager()->getAll();
|
||||
$ids = [];
|
||||
|
|
@ -1002,6 +1034,7 @@ class AppManager implements IAppManager {
|
|||
$this->getNavigationManager()->setDefaultEntryIds($ids);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function isBackendRequired(string $backend): bool {
|
||||
foreach ($this->appInfos as $appInfo) {
|
||||
if (
|
||||
|
|
@ -1031,6 +1064,7 @@ class AppManager implements IAppManager {
|
|||
* @psalm-taint-escape sql
|
||||
* @psalm-taint-escape unserialize
|
||||
*/
|
||||
#[\Override]
|
||||
public function cleanAppId(string $app): string {
|
||||
/* Only lowercase alphanumeric is allowed */
|
||||
$cleanAppId = preg_replace('/(^[0-9_-]+|[^a-z0-9_-]+|[_-]+$)/', '', $app, -1, $count);
|
||||
|
|
@ -1068,6 +1102,7 @@ class AppManager implements IAppManager {
|
|||
*
|
||||
* @throws AppPathNotFoundException if app folder can't be found
|
||||
*/
|
||||
#[\Override]
|
||||
public function upgradeApp(string $appId): bool {
|
||||
// for apps distributed with core, we refresh app path in case the downloaded version
|
||||
// have been installed in custom apps and not in the default path
|
||||
|
|
@ -1138,6 +1173,7 @@ class AppManager implements IAppManager {
|
|||
return true;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function isUpgradeRequired(string $appId): bool {
|
||||
$versions = $this->getAppInstalledVersions();
|
||||
$currentVersion = $this->getAppVersion($appId);
|
||||
|
|
@ -1157,6 +1193,7 @@ class AppManager implements IAppManager {
|
|||
return false;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function isAppCompatible(string $serverVersion, array $appInfo, bool $ignoreMax = false): bool {
|
||||
return count($this->dependencyAnalyzer->analyzeServerVersion($serverVersion, $appInfo, $ignoreMax)) === 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class EducationBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getName() {
|
||||
return $this->l10n->t('Education bundle');
|
||||
}
|
||||
|
|
@ -19,6 +20,7 @@ class EducationBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppIdentifiers() {
|
||||
return [
|
||||
'dashboard',
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class EnterpriseBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getName(): string {
|
||||
return $this->l10n->t('Enterprise bundle');
|
||||
}
|
||||
|
|
@ -19,6 +20,7 @@ class EnterpriseBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppIdentifiers(): array {
|
||||
return [
|
||||
'admin_audit',
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class GroupwareBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getName() {
|
||||
return $this->l10n->t('Groupware bundle');
|
||||
}
|
||||
|
|
@ -19,6 +20,7 @@ class GroupwareBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppIdentifiers() {
|
||||
return [
|
||||
'calendar',
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ declare(strict_types=1);
|
|||
namespace OC\App\AppStore\Bundles;
|
||||
|
||||
class HubBundle extends Bundle {
|
||||
#[\Override]
|
||||
public function getName() {
|
||||
return $this->l10n->t('Hub bundle');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAppIdentifiers() {
|
||||
$hubApps = [
|
||||
'spreed',
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class PublicSectorBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getName(): string {
|
||||
return $this->l10n->t('Public sector bundle');
|
||||
}
|
||||
|
|
@ -19,6 +20,7 @@ class PublicSectorBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppIdentifiers(): array {
|
||||
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class SocialSharingBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getName() {
|
||||
return $this->l10n->t('Social sharing bundle');
|
||||
}
|
||||
|
|
@ -19,6 +20,7 @@ class SocialSharingBundle extends Bundle {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppIdentifiers() {
|
||||
return [
|
||||
'socialsharing_twitter',
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ class AppDiscoverFetcher extends Fetcher {
|
|||
*
|
||||
* @param bool $allowUnstable Include also upcoming entries
|
||||
*/
|
||||
#[\Override]
|
||||
public function get($allowUnstable = false) {
|
||||
$entries = parent::get(false);
|
||||
$now = new DateTimeImmutable();
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ class AppFetcher extends Fetcher {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
#[\Override]
|
||||
protected function fetch($ETag, $content, $allowUnstable = false) {
|
||||
/** @var mixed[] $response */
|
||||
$response = parent::fetch($ETag, $content);
|
||||
|
|
@ -145,12 +146,14 @@ class AppFetcher extends Fetcher {
|
|||
* @param string $fileName
|
||||
* @param bool $ignoreMaxVersion
|
||||
*/
|
||||
#[\Override]
|
||||
public function setVersion(string $version, string $fileName = 'apps.json', bool $ignoreMaxVersion = true) {
|
||||
parent::setVersion($version);
|
||||
$this->fileName = $fileName;
|
||||
$this->ignoreMaxVersion = $ignoreMaxVersion;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function get($allowUnstable = false): array {
|
||||
$allowPreReleases = $allowUnstable || $this->getChannel() === 'beta' || $this->getChannel() === 'daily' || $this->getChannel() === 'git';
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return list<string> list of app ids
|
||||
* @since 7.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getApps(): array {
|
||||
$this->loadConfig(lazy: true);
|
||||
$apps = array_merge(array_keys($this->fastCache), array_keys($this->lazyCache));
|
||||
|
|
@ -115,6 +116,7 @@ class AppConfig implements IAppConfig {
|
|||
*
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getKeys(string $app): array {
|
||||
$this->assertParams($app);
|
||||
$this->loadConfig($app, true);
|
||||
|
|
@ -133,6 +135,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return list<string> list of stored config keys
|
||||
* @since 32.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function searchKeys(string $app, string $prefix = '', bool $lazy = false): array {
|
||||
$this->assertParams($app);
|
||||
$this->loadConfig($app, $lazy);
|
||||
|
|
@ -161,6 +164,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 7.0.0
|
||||
* @since 29.0.0 Added the $lazy argument
|
||||
*/
|
||||
#[\Override]
|
||||
public function hasKey(string $app, string $key, ?bool $lazy = false): bool {
|
||||
$this->assertParams($app, $key);
|
||||
$this->loadConfig($app, $lazy ?? true);
|
||||
|
|
@ -184,6 +188,7 @@ class AppConfig implements IAppConfig {
|
|||
* @throws AppConfigUnknownKeyException if config key is not known
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function isSensitive(string $app, string $key, ?bool $lazy = false): bool {
|
||||
$this->assertParams($app, $key);
|
||||
$this->loadConfig(null, $lazy ?? true);
|
||||
|
|
@ -207,6 +212,7 @@ class AppConfig implements IAppConfig {
|
|||
* @see IAppConfig for details about lazy loading
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function isLazy(string $app, string $key): bool {
|
||||
$this->assertParams($app, $key);
|
||||
$this->matchAndApplyLexiconDefinition($app, $key);
|
||||
|
|
@ -235,6 +241,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return array<string, string|int|float|bool|array> [configKey => configValue]
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAllValues(string $app, string $prefix = '', bool $filtered = false): array {
|
||||
$this->assertParams($app, $prefix);
|
||||
// if we want to filter values, we need to get sensitivity
|
||||
|
|
@ -280,6 +287,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return array<string, string|int|float|bool|array> [appId => configValue]
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function searchValues(string $key, bool $lazy = false, ?int $typedAs = null): array {
|
||||
$this->assertParams('', $key, true);
|
||||
$this->loadConfig(null, $lazy);
|
||||
|
|
@ -360,6 +368,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getValueString(
|
||||
string $app,
|
||||
string $key,
|
||||
|
|
@ -383,6 +392,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getValueInt(
|
||||
string $app,
|
||||
string $key,
|
||||
|
|
@ -406,6 +416,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getValueFloat(string $app, string $key, float $default = 0, bool $lazy = false): float {
|
||||
return (float)$this->getTypedValue($app, $key, (string)$default, $lazy, self::VALUE_FLOAT);
|
||||
}
|
||||
|
|
@ -424,6 +435,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getValueBool(string $app, string $key, bool $default = false, bool $lazy = false): bool {
|
||||
$b = strtolower($this->getTypedValue($app, $key, $default ? 'true' : 'false', $lazy, self::VALUE_BOOL));
|
||||
return in_array($b, ['1', 'true', 'yes', 'on']);
|
||||
|
|
@ -443,6 +455,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getValueArray(
|
||||
string $app,
|
||||
string $key,
|
||||
|
|
@ -552,6 +565,7 @@ class AppConfig implements IAppConfig {
|
|||
* @see VALUE_BOOL
|
||||
* @see VALUE_ARRAY
|
||||
*/
|
||||
#[\Override]
|
||||
public function getValueType(string $app, string $key, ?bool $lazy = null): int {
|
||||
$type = self::VALUE_MIXED;
|
||||
$ignorable = $lazy ?? false;
|
||||
|
|
@ -627,6 +641,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setValueString(
|
||||
string $app,
|
||||
string $key,
|
||||
|
|
@ -657,6 +672,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setValueInt(
|
||||
string $app,
|
||||
string $key,
|
||||
|
|
@ -691,6 +707,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setValueFloat(
|
||||
string $app,
|
||||
string $key,
|
||||
|
|
@ -720,6 +737,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setValueBool(
|
||||
string $app,
|
||||
string $key,
|
||||
|
|
@ -750,6 +768,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setValueArray(
|
||||
string $app,
|
||||
string $key,
|
||||
|
|
@ -973,6 +992,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return bool TRUE if entry was found in database and an update was necessary
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function updateSensitive(string $app, string $key, bool $sensitive): bool {
|
||||
$this->assertParams($app, $key);
|
||||
$this->loadConfig(lazy: true);
|
||||
|
|
@ -1033,6 +1053,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return bool TRUE if entry was found in database and an update was necessary
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function updateLazy(string $app, string $key, bool $lazy): bool {
|
||||
$this->assertParams($app, $key);
|
||||
$this->loadConfig(lazy: true);
|
||||
|
|
@ -1069,6 +1090,7 @@ class AppConfig implements IAppConfig {
|
|||
* @throws AppConfigUnknownKeyException if config key is not known in database
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getDetails(string $app, string $key): array {
|
||||
$this->assertParams($app, $key);
|
||||
$this->loadConfig(lazy: true);
|
||||
|
|
@ -1119,6 +1141,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return array{app: string, key: string, lazy?: bool, valueType?: ValueType, valueTypeName?: string, sensitive?: bool, internal?: bool, default?: string, definition?: string, note?: string}
|
||||
* @since 32.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getKeyDetails(string $app, string $key): array {
|
||||
$this->assertParams($app, $key);
|
||||
try {
|
||||
|
|
@ -1161,6 +1184,7 @@ class AppConfig implements IAppConfig {
|
|||
* @throws AppConfigIncorrectTypeException
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function convertTypeToInt(string $type): int {
|
||||
return match (strtolower($type)) {
|
||||
'mixed' => IAppConfig::VALUE_MIXED,
|
||||
|
|
@ -1180,6 +1204,7 @@ class AppConfig implements IAppConfig {
|
|||
* @throws AppConfigIncorrectTypeException
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function convertTypeToString(int $type): string {
|
||||
$type &= ~self::VALUE_SENSITIVE;
|
||||
|
||||
|
|
@ -1202,6 +1227,7 @@ class AppConfig implements IAppConfig {
|
|||
*
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteKey(string $app, string $key): void {
|
||||
$this->assertParams($app, $key);
|
||||
$this->matchAndApplyLexiconDefinition($app, $key);
|
||||
|
|
@ -1225,6 +1251,7 @@ class AppConfig implements IAppConfig {
|
|||
*
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteApp(string $app): void {
|
||||
$this->assertParams($app);
|
||||
$qb = $this->connection->getQueryBuilder();
|
||||
|
|
@ -1243,6 +1270,7 @@ class AppConfig implements IAppConfig {
|
|||
* @internal
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function clearCache(bool $reload = false): void {
|
||||
$this->lazyLoaded = $this->fastLoaded = false;
|
||||
$this->lazyCache = $this->fastCache = $this->valueTypes = $this->configLexiconDetails = [];
|
||||
|
|
@ -1448,6 +1476,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return array|false
|
||||
* @deprecated 29.0.0 use {@see getAllValues()}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getValues($app, $key) {
|
||||
if (($app !== false) === ($key !== false)) {
|
||||
return false;
|
||||
|
|
@ -1469,6 +1498,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return array
|
||||
* @deprecated 29.0.0 use {@see getAllValues()}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFilteredValues($app) {
|
||||
return $this->getAllValues($app, filtered: true);
|
||||
}
|
||||
|
|
@ -1828,6 +1858,7 @@ class AppConfig implements IAppConfig {
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppInstalledVersions(bool $onlyEnabled = false): array {
|
||||
if ($this->appVersionsCache === null) {
|
||||
/** @var array<string, string> */
|
||||
|
|
|
|||
|
|
@ -18,14 +18,17 @@ class BootContext implements IBootContext {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAppContainer(): IAppContainer {
|
||||
return $this->appContainer;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getServerContainer(): IServerContainer {
|
||||
return $this->appContainer->get(IServerContainer::class);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function injectFn(callable $fn) {
|
||||
return (new FunctionInjector($this->appContainer))->injectFn($fn);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ class RegistrationContext {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerCapability(string $capability): void {
|
||||
$this->context->registerCapability(
|
||||
$this->appId,
|
||||
|
|
@ -186,6 +187,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerCrashReporter(string $reporterClass): void {
|
||||
$this->context->registerCrashReporter(
|
||||
$this->appId,
|
||||
|
|
@ -193,6 +195,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerDashboardWidget(string $widgetClass): void {
|
||||
$this->context->registerDashboardPanel(
|
||||
$this->appId,
|
||||
|
|
@ -200,6 +203,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerService(string $name, callable $factory, bool $shared = true): void {
|
||||
$this->context->registerService(
|
||||
$this->appId,
|
||||
|
|
@ -209,6 +213,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerServiceAlias(string $alias, string $target): void {
|
||||
$this->context->registerServiceAlias(
|
||||
$this->appId,
|
||||
|
|
@ -217,6 +222,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerParameter(string $name, $value): void {
|
||||
$this->context->registerParameter(
|
||||
$this->appId,
|
||||
|
|
@ -225,6 +231,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerEventListener(string $event, string $listener, int $priority = 0): void {
|
||||
$this->context->registerEventListener(
|
||||
$this->appId,
|
||||
|
|
@ -234,6 +241,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerMiddleware(string $class, bool $global = false): void {
|
||||
$this->context->registerMiddleware(
|
||||
$this->appId,
|
||||
|
|
@ -242,6 +250,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerSearchProvider(string $class): void {
|
||||
$this->context->registerSearchProvider(
|
||||
$this->appId,
|
||||
|
|
@ -249,6 +258,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerAlternativeLogin(string $class): void {
|
||||
$this->context->registerAlternativeLogin(
|
||||
$this->appId,
|
||||
|
|
@ -264,6 +274,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerInitialStateProvider(string $class): void {
|
||||
$this->context->registerInitialState(
|
||||
$this->appId,
|
||||
|
|
@ -271,6 +282,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerWellKnownHandler(string $class): void {
|
||||
$this->context->registerWellKnown(
|
||||
$this->appId,
|
||||
|
|
@ -278,12 +290,14 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerSpeechToTextProvider(string $providerClass): void {
|
||||
$this->context->registerSpeechToTextProvider(
|
||||
$this->appId,
|
||||
$providerClass
|
||||
);
|
||||
}
|
||||
#[\Override]
|
||||
public function registerTextProcessingProvider(string $providerClass): void {
|
||||
$this->context->registerTextProcessingProvider(
|
||||
$this->appId,
|
||||
|
|
@ -291,6 +305,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerTextToImageProvider(string $providerClass): void {
|
||||
$this->context->registerTextToImageProvider(
|
||||
$this->appId,
|
||||
|
|
@ -298,6 +313,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerTemplateProvider(string $providerClass): void {
|
||||
$this->context->registerTemplateProvider(
|
||||
$this->appId,
|
||||
|
|
@ -305,6 +321,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerTranslationProvider(string $providerClass): void {
|
||||
$this->context->registerTranslationProvider(
|
||||
$this->appId,
|
||||
|
|
@ -312,6 +329,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerNotifierService(string $notifierClass): void {
|
||||
$this->context->registerNotifierService(
|
||||
$this->appId,
|
||||
|
|
@ -319,6 +337,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerTwoFactorProvider(string $twoFactorProviderClass): void {
|
||||
$this->context->registerTwoFactorProvider(
|
||||
$this->appId,
|
||||
|
|
@ -326,6 +345,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerPreviewProvider(string $previewProviderClass, string $mimeTypeRegex): void {
|
||||
$this->context->registerPreviewProvider(
|
||||
$this->appId,
|
||||
|
|
@ -334,6 +354,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerCalendarProvider(string $class): void {
|
||||
$this->context->registerCalendarProvider(
|
||||
$this->appId,
|
||||
|
|
@ -341,6 +362,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerReferenceProvider(string $class): void {
|
||||
$this->context->registerReferenceProvider(
|
||||
$this->appId,
|
||||
|
|
@ -348,6 +370,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerProfileLinkAction(string $actionClass): void {
|
||||
$this->context->registerProfileLinkAction(
|
||||
$this->appId,
|
||||
|
|
@ -355,6 +378,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerTalkBackend(string $backend): void {
|
||||
$this->context->registerTalkBackend(
|
||||
$this->appId,
|
||||
|
|
@ -362,6 +386,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerCalendarResourceBackend(string $class): void {
|
||||
$this->context->registerCalendarResourceBackend(
|
||||
$this->appId,
|
||||
|
|
@ -369,6 +394,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerTeamResourceProvider(string $class) : void {
|
||||
$this->context->registerTeamResourceProvider(
|
||||
$this->appId,
|
||||
|
|
@ -376,6 +402,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerCalendarRoomBackend(string $class): void {
|
||||
$this->context->registerCalendarRoomBackend(
|
||||
$this->appId,
|
||||
|
|
@ -383,6 +410,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerUserMigrator(string $migratorClass): void {
|
||||
$this->context->registerUserMigrator(
|
||||
$this->appId,
|
||||
|
|
@ -390,6 +418,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerSensitiveMethods(string $class, array $methods): void {
|
||||
$this->context->registerSensitiveMethods(
|
||||
$this->appId,
|
||||
|
|
@ -398,6 +427,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerPublicShareTemplateProvider(string $class): void {
|
||||
$this->context->registerPublicShareTemplateProvider(
|
||||
$this->appId,
|
||||
|
|
@ -405,6 +435,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerSetupCheck(string $setupCheckClass): void {
|
||||
$this->context->registerSetupCheck(
|
||||
$this->appId,
|
||||
|
|
@ -412,6 +443,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerDeclarativeSettings(string $declarativeSettingsClass): void {
|
||||
$this->context->registerDeclarativeSettings(
|
||||
$this->appId,
|
||||
|
|
@ -419,6 +451,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerTaskProcessingProvider(string $taskProcessingProviderClass): void {
|
||||
$this->context->registerTaskProcessingProvider(
|
||||
$this->appId,
|
||||
|
|
@ -426,6 +459,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerTaskProcessingTaskType(string $taskProcessingTaskTypeClass): void {
|
||||
$this->context->registerTaskProcessingTaskType(
|
||||
$this->appId,
|
||||
|
|
@ -433,6 +467,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerFileConversionProvider(string $class): void {
|
||||
$this->context->registerFileConversionProvider(
|
||||
$this->appId,
|
||||
|
|
@ -440,6 +475,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerMailProvider(string $class): void {
|
||||
$this->context->registerMailProvider(
|
||||
$this->appId,
|
||||
|
|
@ -447,6 +483,7 @@ class RegistrationContext {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerConfigLexicon(string $configLexiconClass): void {
|
||||
$this->context->registerConfigLexicon(
|
||||
$this->appId,
|
||||
|
|
|
|||
|
|
@ -256,6 +256,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
$this->registerAlias(IInitialState::class, InitialState::class);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getServer(): ServerContainer {
|
||||
return $this->server;
|
||||
}
|
||||
|
|
@ -263,6 +264,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
/**
|
||||
* @param string $middleWare
|
||||
*/
|
||||
#[\Override]
|
||||
public function registerMiddleWare($middleWare): bool {
|
||||
if (in_array($middleWare, $this->middleWares, true) !== false) {
|
||||
return false;
|
||||
|
|
@ -275,6 +277,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
* used to return the appname of the set application
|
||||
* @return string the name of your application
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppName() {
|
||||
return $this->query('appName');
|
||||
}
|
||||
|
|
@ -305,12 +308,14 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
*
|
||||
* @param string $serviceName e.g. 'OCA\Files\Capabilities'
|
||||
*/
|
||||
#[\Override]
|
||||
public function registerCapability($serviceName) {
|
||||
$this->query(CapabilitiesManager::class)->registerCapability(function () use ($serviceName) {
|
||||
return $this->query($serviceName);
|
||||
});
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function has($id): bool {
|
||||
if (parent::has($id)) {
|
||||
return true;
|
||||
|
|
@ -327,6 +332,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
* @inheritDoc
|
||||
* @param list<class-string> $chain
|
||||
*/
|
||||
#[\Override]
|
||||
public function query(string $name, bool $autoload = true, array $chain = []): mixed {
|
||||
if ($name === 'AppName' || $name === 'appName') {
|
||||
return $this->appName;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class Output implements IOutput {
|
|||
/**
|
||||
* @param string $out
|
||||
*/
|
||||
#[\Override]
|
||||
public function setOutput($out) {
|
||||
print($out);
|
||||
}
|
||||
|
|
@ -30,6 +31,7 @@ class Output implements IOutput {
|
|||
*
|
||||
* @return bool false if an error occurred
|
||||
*/
|
||||
#[\Override]
|
||||
public function setReadfile($path) {
|
||||
if (is_resource($path)) {
|
||||
$output = fopen('php://output', 'w');
|
||||
|
|
@ -42,6 +44,7 @@ class Output implements IOutput {
|
|||
/**
|
||||
* @param string $header
|
||||
*/
|
||||
#[\Override]
|
||||
public function setHeader($header) {
|
||||
header($header);
|
||||
}
|
||||
|
|
@ -49,6 +52,7 @@ class Output implements IOutput {
|
|||
/**
|
||||
* @param int $code sets the http status code
|
||||
*/
|
||||
#[\Override]
|
||||
public function setHttpResponseCode($code) {
|
||||
http_response_code($code);
|
||||
}
|
||||
|
|
@ -56,6 +60,7 @@ class Output implements IOutput {
|
|||
/**
|
||||
* @return int returns the current http response code
|
||||
*/
|
||||
#[\Override]
|
||||
public function getHttpResponseCode() {
|
||||
return http_response_code();
|
||||
}
|
||||
|
|
@ -69,6 +74,7 @@ class Output implements IOutput {
|
|||
* @param bool $secure
|
||||
* @param bool $httpOnly
|
||||
*/
|
||||
#[\Override]
|
||||
public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly, $sameSite = 'Lax') {
|
||||
$path = $this->webRoot ? : '/';
|
||||
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* Countable method
|
||||
* @return int
|
||||
*/
|
||||
#[\Override]
|
||||
public function count(): int {
|
||||
return \count($this->items['parameters']);
|
||||
}
|
||||
|
|
@ -143,6 +144,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @param string $offset The key to lookup
|
||||
* @return boolean
|
||||
*/
|
||||
#[\Override]
|
||||
public function offsetExists($offset): bool {
|
||||
return isset($this->items['parameters'][$offset]);
|
||||
}
|
||||
|
|
@ -152,6 +154,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @param string $offset
|
||||
* @return mixed
|
||||
*/
|
||||
#[\Override]
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset) {
|
||||
return $this->items['parameters'][$offset] ?? null;
|
||||
|
|
@ -162,6 +165,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @param string $offset
|
||||
* @param mixed $value
|
||||
*/
|
||||
#[\Override]
|
||||
public function offsetSet($offset, $value): void {
|
||||
throw new \RuntimeException('You cannot change the contents of the request object');
|
||||
}
|
||||
|
|
@ -170,6 +174,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @see offsetExists
|
||||
* @param string $offset
|
||||
*/
|
||||
#[\Override]
|
||||
public function offsetUnset($offset): void {
|
||||
throw new \RuntimeException('You cannot change the contents of the request object');
|
||||
}
|
||||
|
|
@ -254,6 +259,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @param string $name
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getHeader(string $name): string {
|
||||
$name = strtoupper(str_replace('-', '_', $name));
|
||||
if (isset($this->server['HTTP_' . $name])) {
|
||||
|
|
@ -288,6 +294,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @param mixed $default If the key is not found, this value will be returned
|
||||
* @return mixed the content of the array
|
||||
*/
|
||||
#[\Override]
|
||||
public function getParam(string $key, $default = null) {
|
||||
return isset($this->parameters[$key])
|
||||
? $this->parameters[$key]
|
||||
|
|
@ -299,6 +306,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* (as GET or POST) or through the URL by the route
|
||||
* @return array the array with all parameters
|
||||
*/
|
||||
#[\Override]
|
||||
public function getParams(): array {
|
||||
return is_array($this->parameters) ? $this->parameters : [];
|
||||
}
|
||||
|
|
@ -307,6 +315,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* Returns the method of the request
|
||||
* @return string the method of the request (POST, GET, etc)
|
||||
*/
|
||||
#[\Override]
|
||||
public function getMethod(): string {
|
||||
return $this->method;
|
||||
}
|
||||
|
|
@ -316,6 +325,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @param string $key the key that will be taken from the $_FILES array
|
||||
* @return array the file in the $_FILES element
|
||||
*/
|
||||
#[\Override]
|
||||
public function getUploadedFile(string $key) {
|
||||
return isset($this->files[$key]) ? $this->files[$key] : null;
|
||||
}
|
||||
|
|
@ -325,6 +335,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @param string $key the key that will be taken from the $_ENV array
|
||||
* @return array the value in the $_ENV element
|
||||
*/
|
||||
#[\Override]
|
||||
public function getEnv(string $key) {
|
||||
return isset($this->env[$key]) ? $this->env[$key] : null;
|
||||
}
|
||||
|
|
@ -334,6 +345,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @param string $key the key that will be taken from the $_COOKIE array
|
||||
* @return string the value in the $_COOKIE element
|
||||
*/
|
||||
#[\Override]
|
||||
public function getCookie(string $key) {
|
||||
return isset($this->cookies[$key]) ? $this->cookies[$key] : null;
|
||||
}
|
||||
|
|
@ -416,6 +428,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
$this->contentDecoded = true;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function throwDecodingExceptionIfAny(): void {
|
||||
if ($this->decodingException !== null) {
|
||||
throw $this->decodingException;
|
||||
|
|
@ -427,6 +440,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* Checks if the CSRF check was correct
|
||||
* @return bool true if CSRF check passed
|
||||
*/
|
||||
#[\Override]
|
||||
public function passesCSRFCheck(): bool {
|
||||
if ($this->csrfTokenManager === null) {
|
||||
return false;
|
||||
|
|
@ -503,6 +517,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @return bool
|
||||
* @since 9.1.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function passesStrictCookieCheck(): bool {
|
||||
if (!$this->cookieCheckRequired()) {
|
||||
return true;
|
||||
|
|
@ -523,6 +538,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @return bool
|
||||
* @since 9.1.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function passesLaxCookieCheck(): bool {
|
||||
if (!$this->cookieCheckRequired()) {
|
||||
return true;
|
||||
|
|
@ -541,6 +557,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* If `mod_unique_id` is installed this value will be taken.
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getId(): string {
|
||||
return $this->requestId->getId();
|
||||
}
|
||||
|
|
@ -568,6 +585,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* Do always use this instead of $_SERVER['REMOTE_ADDR']
|
||||
* @return string IP address
|
||||
*/
|
||||
#[\Override]
|
||||
public function getRemoteAddress(): string {
|
||||
$remoteAddress = isset($this->server['REMOTE_ADDR']) ? $this->server['REMOTE_ADDR'] : '';
|
||||
$trustedProxies = $this->config->getSystemValue('trusted_proxies', []);
|
||||
|
|
@ -630,6 +648,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
*
|
||||
* @return string Server protocol (http or https)
|
||||
*/
|
||||
#[\Override]
|
||||
public function getServerProtocol(): string {
|
||||
$proto = 'http';
|
||||
|
||||
|
|
@ -669,6 +688,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
*
|
||||
* @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0.
|
||||
*/
|
||||
#[\Override]
|
||||
public function getHttpProtocol(): string {
|
||||
$claimedProtocol = $this->server['SERVER_PROTOCOL'] ?? '';
|
||||
|
||||
|
|
@ -694,6 +714,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* reverse proxies
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getRequestUri(): string {
|
||||
$uri = isset($this->server['REQUEST_URI']) ? $this->server['REQUEST_URI'] : '';
|
||||
if ($this->config->getSystemValueString('overwritewebroot') !== '' && $this->isOverwriteCondition()) {
|
||||
|
|
@ -707,6 +728,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @throws \Exception
|
||||
* @return string Path info
|
||||
*/
|
||||
#[\Override]
|
||||
public function getRawPathInfo(): string {
|
||||
$requestUri = isset($this->server['REQUEST_URI']) ? $this->server['REQUEST_URI'] : '';
|
||||
// remove too many slashes - can be caused by reverse proxy configuration
|
||||
|
|
@ -752,6 +774,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @throws \Exception
|
||||
* @return string|false Path info or false when not found
|
||||
*/
|
||||
#[\Override]
|
||||
public function getPathInfo(): string|false {
|
||||
$pathInfo = $this->getRawPathInfo();
|
||||
return \Sabre\HTTP\decodePath($pathInfo);
|
||||
|
|
@ -762,6 +785,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* reverse proxies
|
||||
* @return string the script name
|
||||
*/
|
||||
#[\Override]
|
||||
public function getScriptName(): string {
|
||||
$name = $this->server['SCRIPT_NAME'] ?? '';
|
||||
$overwriteWebRoot = $this->config->getSystemValueString('overwritewebroot');
|
||||
|
|
@ -779,6 +803,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @param array $agent array of agent names
|
||||
* @return bool true if at least one of the given agent matches, false otherwise
|
||||
*/
|
||||
#[\Override]
|
||||
public function isUserAgent(array $agent): bool {
|
||||
if (!isset($this->server['HTTP_USER_AGENT'])) {
|
||||
return false;
|
||||
|
|
@ -796,6 +821,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* whether it is a trusted domain
|
||||
* @return string Server host
|
||||
*/
|
||||
#[\Override]
|
||||
public function getInsecureServerHost(): string {
|
||||
if ($this->fromTrustedProxy() && $this->getOverwriteHost() !== null) {
|
||||
return $this->getOverwriteHost();
|
||||
|
|
@ -826,6 +852,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* trusted domain if the host isn't in the trusted list
|
||||
* @return string Server host
|
||||
*/
|
||||
#[\Override]
|
||||
public function getServerHost(): string {
|
||||
// overwritehost is always trusted
|
||||
$host = $this->getOverwriteHost();
|
||||
|
|
@ -872,6 +899,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
return \is_array($trustedProxies) && $this->isTrustedProxy($trustedProxies, $remoteAddress);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getFormat(): ?string {
|
||||
$format = $this->getParam('format');
|
||||
if ($format !== null) {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class RequestId implements IRequestId {
|
|||
* If `mod_unique_id` is installed this value will be taken.
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getId(): string {
|
||||
if (empty($this->requestId)) {
|
||||
$validChars = ISecureRandom::CHAR_ALPHANUMERIC;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class AdditionalScriptsMiddleware extends Middleware {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function afterController($controller, $methodName, Response $response): Response {
|
||||
if ($response instanceof TemplateResponse) {
|
||||
if ($controller instanceof LoginController) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class CompressionMiddleware extends Middleware {
|
|||
$this->useGZip = false;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function afterController($controller, $methodName, Response $response) {
|
||||
// By default we do not gzip
|
||||
$allowGzip = false;
|
||||
|
|
@ -60,6 +61,7 @@ class CompressionMiddleware extends Middleware {
|
|||
return $response;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function beforeOutput($controller, $methodName, $output) {
|
||||
if (!$this->useGZip) {
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class FlowV2EphemeralSessionsMiddleware extends Middleware {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function beforeController(Controller $controller, string $methodName) {
|
||||
$sessionCreationTime = $this->session->get(ClientFlowLoginV2Controller::EPHEMERAL_NAME);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class NotModifiedMiddleware extends Middleware {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function afterController($controller, $methodName, Response $response) {
|
||||
$etagHeader = $this->request->getHeader('IF_NONE_MATCH');
|
||||
if ($etagHeader !== '' && $response->getETag() !== null && trim($etagHeader) === '"' . $response->getETag() . '"') {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class OCSMiddleware extends Middleware {
|
|||
* @param Controller $controller
|
||||
* @param string $methodName
|
||||
*/
|
||||
#[\Override]
|
||||
public function beforeController($controller, $methodName) {
|
||||
if ($controller instanceof OCSController) {
|
||||
if (substr_compare($this->request->getScriptName(), '/ocs/v2.php', -strlen('/ocs/v2.php')) === 0) {
|
||||
|
|
@ -53,6 +54,7 @@ class OCSMiddleware extends Middleware {
|
|||
* @throws \Exception
|
||||
* @return BaseResponse
|
||||
*/
|
||||
#[\Override]
|
||||
public function afterException($controller, $methodName, \Exception $exception) {
|
||||
if ($controller instanceof OCSController && $exception instanceof OCSException) {
|
||||
$code = $exception->getCode();
|
||||
|
|
@ -72,6 +74,7 @@ class OCSMiddleware extends Middleware {
|
|||
* @param Response $response
|
||||
* @return Response
|
||||
*/
|
||||
#[\Override]
|
||||
public function afterController($controller, $methodName, Response $response) {
|
||||
/*
|
||||
* If a different middleware has detected that a request unauthorized or forbidden
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class PublicShareMiddleware extends Middleware {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function beforeController($controller, $methodName) {
|
||||
if (!($controller instanceof PublicShareController)) {
|
||||
return;
|
||||
|
|
@ -79,6 +80,7 @@ class PublicShareMiddleware extends Middleware {
|
|||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function afterException($controller, $methodName, \Exception $exception) {
|
||||
if (!($controller instanceof PublicShareController)) {
|
||||
throw $exception;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class BruteForceMiddleware extends Middleware {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function beforeController($controller, $methodName) {
|
||||
parent::beforeController($controller, $methodName);
|
||||
|
||||
|
|
@ -70,6 +71,7 @@ class BruteForceMiddleware extends Middleware {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function afterController($controller, $methodName, Response $response) {
|
||||
if ($response->isThrottled()) {
|
||||
try {
|
||||
|
|
@ -123,6 +125,7 @@ class BruteForceMiddleware extends Middleware {
|
|||
* @throws \Exception
|
||||
* @return Response
|
||||
*/
|
||||
#[\Override]
|
||||
public function afterException($controller, $methodName, \Exception $exception): Response {
|
||||
if ($exception instanceof MaxDelayReached) {
|
||||
if ($controller instanceof OCSController) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class CSPMiddleware extends Middleware {
|
|||
* @param Response $response
|
||||
* @return Response
|
||||
*/
|
||||
#[\Override]
|
||||
public function afterController($controller, $methodName, Response $response): Response {
|
||||
$policy = !is_null($response->getContentSecurityPolicy()) ? $response->getContentSecurityPolicy() : new ContentSecurityPolicy();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class FeaturePolicyMiddleware extends Middleware {
|
|||
* @param Response $response
|
||||
* @return Response
|
||||
*/
|
||||
#[\Override]
|
||||
public function afterController($controller, $methodName, Response $response): Response {
|
||||
$policy = !is_null($response->getFeaturePolicy()) ? $response->getFeaturePolicy() : new FeaturePolicy();
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ class PasswordConfirmationMiddleware extends Middleware {
|
|||
/**
|
||||
* @throws NotConfirmedException
|
||||
*/
|
||||
#[\Override]
|
||||
public function beforeController(Controller $controller, string $methodName) {
|
||||
if (!$this->needsPasswordConfirmation()) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class RateLimitingMiddleware extends Middleware {
|
|||
* {@inheritDoc}
|
||||
* @throws RateLimitExceededException
|
||||
*/
|
||||
#[\Override]
|
||||
public function beforeController(Controller $controller, string $methodName): void {
|
||||
parent::beforeController($controller, $methodName);
|
||||
$rateLimitIdentifier = get_class($controller) . '::' . $methodName;
|
||||
|
|
@ -184,6 +185,7 @@ class RateLimitingMiddleware extends Middleware {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function afterException(Controller $controller, string $methodName, \Exception $exception): Response {
|
||||
if ($exception instanceof RateLimitExceededException) {
|
||||
if (stripos($this->request->getHeader('Accept'), 'html') === false) {
|
||||
|
|
|
|||
|
|
@ -25,12 +25,14 @@ class ReloadExecutionMiddleware extends Middleware {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function beforeController($controller, $methodName) {
|
||||
if ($this->session->exists('clearingExecutionContexts')) {
|
||||
throw new ReloadExecutionException();
|
||||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function afterException($controller, $methodName, \Exception $exception) {
|
||||
if ($exception instanceof ReloadExecutionException) {
|
||||
$this->session->remove('clearingExecutionContexts');
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class SameSiteCookieMiddleware extends Middleware {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function beforeController($controller, $methodName) {
|
||||
$requestUri = $this->request->getScriptName();
|
||||
$processingScript = explode('/', $requestUri);
|
||||
|
|
@ -44,6 +45,7 @@ class SameSiteCookieMiddleware extends Middleware {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function afterException($controller, $methodName, \Exception $exception) {
|
||||
if ($exception instanceof LaxSameSiteCookieFailedException) {
|
||||
$response = new Response();
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ class SecurityMiddleware extends Middleware {
|
|||
*
|
||||
* @suppress PhanUndeclaredClassConstant
|
||||
*/
|
||||
#[\Override]
|
||||
public function beforeController($controller, $methodName) {
|
||||
// this will set the current navigation entry of the app, use this only
|
||||
// for normal HTML requests and not for AJAX requests
|
||||
|
|
@ -250,6 +251,7 @@ class SecurityMiddleware extends Middleware {
|
|||
* @return Response a Response object or null in case that the exception could not be handled
|
||||
* @throws \Exception the passed in exception if it can't handle it
|
||||
*/
|
||||
#[\Override]
|
||||
public function afterException($controller, $methodName, \Exception $exception): Response {
|
||||
if ($exception instanceof SecurityException) {
|
||||
if ($exception instanceof StrictCookieMissingException) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class SessionMiddleware extends Middleware {
|
|||
* @param Controller $controller
|
||||
* @param string $methodName
|
||||
*/
|
||||
#[\Override]
|
||||
public function beforeController($controller, $methodName) {
|
||||
if ($this->reflector->hasAnnotationOrAttribute('UseSession', UseSession::class)) {
|
||||
$this->session->reopen();
|
||||
|
|
@ -38,6 +39,7 @@ class SessionMiddleware extends Middleware {
|
|||
* @param Response $response
|
||||
* @return Response
|
||||
*/
|
||||
#[\Override]
|
||||
public function afterController($controller, $methodName, Response $response) {
|
||||
if ($this->reflector->hasAnnotationOrAttribute('UseSession', UseSession::class)) {
|
||||
$this->session->close();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class V1Response extends BaseResponse {
|
|||
*
|
||||
* @return Http::STATUS_*
|
||||
*/
|
||||
#[\Override]
|
||||
public function getStatus() {
|
||||
$status = parent::getStatus();
|
||||
if ($status === OCSController::RESPOND_UNAUTHORISED) {
|
||||
|
|
@ -37,6 +38,7 @@ class V1Response extends BaseResponse {
|
|||
*
|
||||
* @return int
|
||||
*/
|
||||
#[\Override]
|
||||
public function getOCSStatus() {
|
||||
$status = parent::getOCSStatus();
|
||||
|
||||
|
|
@ -53,6 +55,7 @@ class V1Response extends BaseResponse {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function render() {
|
||||
$meta = [
|
||||
'status' => $this->getOCSStatus() === 100 ? 'ok' : 'failure',
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class V2Response extends BaseResponse {
|
|||
*
|
||||
* @return Http::STATUS_*
|
||||
*/
|
||||
#[\Override]
|
||||
public function getStatus() {
|
||||
$status = parent::getStatus();
|
||||
if ($status === OCSController::RESPOND_UNAUTHORISED) {
|
||||
|
|
@ -44,6 +45,7 @@ class V2Response extends BaseResponse {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function render() {
|
||||
$status = parent::getStatus();
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class ScopedPsrLogger implements LoggerInterface {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function emergency($message, array $context = []): void {
|
||||
$this->inner->emergency(
|
||||
$message,
|
||||
|
|
@ -30,6 +31,7 @@ class ScopedPsrLogger implements LoggerInterface {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function alert($message, array $context = []): void {
|
||||
$this->inner->alert(
|
||||
$message,
|
||||
|
|
@ -42,6 +44,7 @@ class ScopedPsrLogger implements LoggerInterface {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function critical($message, array $context = []): void {
|
||||
$this->inner->critical(
|
||||
$message,
|
||||
|
|
@ -54,6 +57,7 @@ class ScopedPsrLogger implements LoggerInterface {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function error($message, array $context = []): void {
|
||||
$this->inner->error(
|
||||
$message,
|
||||
|
|
@ -66,6 +70,7 @@ class ScopedPsrLogger implements LoggerInterface {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function warning($message, array $context = []): void {
|
||||
$this->inner->warning(
|
||||
$message,
|
||||
|
|
@ -78,6 +83,7 @@ class ScopedPsrLogger implements LoggerInterface {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function notice($message, array $context = []): void {
|
||||
$this->inner->notice(
|
||||
$message,
|
||||
|
|
@ -90,6 +96,7 @@ class ScopedPsrLogger implements LoggerInterface {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function info($message, array $context = []): void {
|
||||
$this->inner->info(
|
||||
$message,
|
||||
|
|
@ -102,6 +109,7 @@ class ScopedPsrLogger implements LoggerInterface {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function debug($message, array $context = []): void {
|
||||
$this->inner->debug(
|
||||
$message,
|
||||
|
|
@ -114,6 +122,7 @@ class ScopedPsrLogger implements LoggerInterface {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function log($level, $message, array $context = []): void {
|
||||
$this->inner->log(
|
||||
$level,
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return string[] list of stored config keys
|
||||
* @since 20.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppKeys(): array {
|
||||
return $this->appConfig->getKeys($this->appName);
|
||||
}
|
||||
|
|
@ -43,6 +44,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return bool TRUE if key exists
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function hasAppKey(string $key, ?bool $lazy = false): bool {
|
||||
return $this->appConfig->hasKey($this->appName, $key, $lazy);
|
||||
}
|
||||
|
|
@ -55,6 +57,7 @@ class AppConfig implements IAppConfig {
|
|||
* @throws AppConfigUnknownKeyException if config key is not known
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function isSensitive(string $key, ?bool $lazy = false): bool {
|
||||
return $this->appConfig->isSensitive($this->appName, $key, $lazy);
|
||||
}
|
||||
|
|
@ -69,6 +72,7 @@ class AppConfig implements IAppConfig {
|
|||
* @see \OCP\IAppConfig for details about lazy loading
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function isLazy(string $key): bool {
|
||||
return $this->appConfig->isLazy($this->appName, $key);
|
||||
}
|
||||
|
|
@ -82,6 +86,7 @@ class AppConfig implements IAppConfig {
|
|||
* @return array<string, string|int|float|bool|array> [configKey => configValue]
|
||||
* @since 29.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAllAppValues(string $key = '', bool $filtered = false): array {
|
||||
return $this->appConfig->getAllValues($this->appName, $key, $filtered);
|
||||
}
|
||||
|
|
@ -94,6 +99,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 20.0.0
|
||||
* @deprecated 29.0.0 use {@see setAppValueString()}
|
||||
*/
|
||||
#[\Override]
|
||||
public function setAppValue(string $key, string $value): void {
|
||||
/** @psalm-suppress InternalMethod */
|
||||
$this->appConfig->setValueMixed($this->appName, $key, $value);
|
||||
|
|
@ -112,6 +118,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setAppValueString(
|
||||
string $key,
|
||||
string $value,
|
||||
|
|
@ -134,6 +141,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setAppValueInt(
|
||||
string $key,
|
||||
int $value,
|
||||
|
|
@ -156,6 +164,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setAppValueFloat(
|
||||
string $key,
|
||||
float $value,
|
||||
|
|
@ -177,6 +186,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setAppValueBool(
|
||||
string $key,
|
||||
bool $value,
|
||||
|
|
@ -199,6 +209,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function setAppValueArray(
|
||||
string $key,
|
||||
array $value,
|
||||
|
|
@ -216,6 +227,7 @@ class AppConfig implements IAppConfig {
|
|||
* @deprecated 29.0.0 use {@see getAppValueString()}
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppValue(string $key, string $default = ''): string {
|
||||
/** @psalm-suppress InternalMethod */
|
||||
/** @psalm-suppress UndefinedInterfaceMethod */
|
||||
|
|
@ -235,6 +247,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppValueString(string $key, string $default = '', bool $lazy = false): string {
|
||||
return $this->appConfig->getValueString($this->appName, $key, $default, $lazy);
|
||||
}
|
||||
|
|
@ -252,6 +265,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppValueInt(string $key, int $default = 0, bool $lazy = false): int {
|
||||
return $this->appConfig->getValueInt($this->appName, $key, $default, $lazy);
|
||||
}
|
||||
|
|
@ -269,6 +283,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppValueFloat(string $key, float $default = 0, bool $lazy = false): float {
|
||||
return $this->appConfig->getValueFloat($this->appName, $key, $default, $lazy);
|
||||
}
|
||||
|
|
@ -286,6 +301,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppValueBool(string $key, bool $default = false, bool $lazy = false): bool {
|
||||
return $this->appConfig->getValueBool($this->appName, $key, $default, $lazy);
|
||||
}
|
||||
|
|
@ -303,6 +319,7 @@ class AppConfig implements IAppConfig {
|
|||
* @since 29.0.0
|
||||
* @see \OCP\IAppConfig for explanation about lazy loading
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAppValueArray(string $key, array $default = [], bool $lazy = false): array {
|
||||
return $this->appConfig->getValueArray($this->appName, $key, $default, $lazy);
|
||||
}
|
||||
|
|
@ -313,6 +330,7 @@ class AppConfig implements IAppConfig {
|
|||
* @param string $key the key of the value, under which it was saved
|
||||
* @since 20.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteAppValue(string $key): void {
|
||||
$this->appConfig->deleteKey($this->appName, $key);
|
||||
}
|
||||
|
|
@ -322,18 +340,22 @@ class AppConfig implements IAppConfig {
|
|||
*
|
||||
* @since 20.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function deleteAppValues(): void {
|
||||
$this->appConfig->deleteApp($this->appName);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setUserValue(string $userId, string $key, string $value, ?string $preCondition = null): void {
|
||||
$this->config->setUserValue($userId, $this->appName, $key, $value, $preCondition);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getUserValue(string $userId, string $key, string $default = ''): string {
|
||||
return $this->config->getUserValue($userId, $this->appName, $key, $default);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function deleteUserValue(string $userId, string $key): void {
|
||||
$this->config->deleteUserValue($userId, $this->appName, $key);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,12 @@ class InitialState implements IInitialState {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function provideInitialState(string $key, $data): void {
|
||||
$this->state->provideInitialState($this->appName, $key, $data);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function provideLazyInitialState(string $key, \Closure $closure): void {
|
||||
$this->state->provideLazyInitialState($this->appName, $key, $closure);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
|
|||
* @return string|null type in the type parameters (@param int $something)
|
||||
* would return int or null if not existing
|
||||
*/
|
||||
#[\Override]
|
||||
public function getType(string $parameter) {
|
||||
if (array_key_exists($parameter, $this->types)) {
|
||||
return $this->types[$parameter];
|
||||
|
|
@ -121,6 +122,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
|
|||
/**
|
||||
* @return array the arguments of the method with key => default value
|
||||
*/
|
||||
#[\Override]
|
||||
public function getParameters(): array {
|
||||
return $this->parameters;
|
||||
}
|
||||
|
|
@ -130,6 +132,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
|
|||
*
|
||||
* @param class-string<T> $attributeClass
|
||||
*/
|
||||
#[\Override]
|
||||
public function hasAnnotationOrAttribute(?string $annotationName, string $attributeClass): bool {
|
||||
if (!empty($this->reflectionMethod->getAttributes($attributeClass))) {
|
||||
return true;
|
||||
|
|
@ -148,6 +151,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
|
|||
* @param string $name the name of the annotation
|
||||
* @return bool true if the annotation is found
|
||||
*/
|
||||
#[\Override]
|
||||
public function hasAnnotation(string $name): bool {
|
||||
$name = strtolower($name);
|
||||
return array_key_exists($name, $this->annotations);
|
||||
|
|
|
|||
|
|
@ -39,10 +39,12 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
* @param class-string<T>|string $id
|
||||
* @return ($id is class-string<T> ? T : mixed)
|
||||
*/
|
||||
#[\Override]
|
||||
public function get(string $id): mixed {
|
||||
return $this->query($id);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function has(string $id): bool {
|
||||
// If a service is no registered but is an existing class, we can probably load it
|
||||
return isset($this->container[$id]) || class_exists($id);
|
||||
|
|
@ -120,6 +122,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
* @inheritDoc
|
||||
* @param list<class-string> $chain
|
||||
*/
|
||||
#[\Override]
|
||||
public function resolve(string $name, array $chain = []): mixed {
|
||||
$baseMsg = 'Could not resolve ' . $name . '!';
|
||||
try {
|
||||
|
|
@ -140,6 +143,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
* @inheritDoc
|
||||
* @param list<class-string> $chain
|
||||
*/
|
||||
#[\Override]
|
||||
public function query(string $name, bool $autoload = true, array $chain = []): mixed {
|
||||
$name = $this->sanitizeName($name);
|
||||
if (isset($this->container[$name])) {
|
||||
|
|
@ -161,10 +165,12 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
throw new QueryNotFoundException('Could not resolve ' . $name . '!');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerParameter(string $name, mixed $value): void {
|
||||
$this[$name] = $value;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function registerService(string $name, Closure $closure, bool $shared = true): void {
|
||||
$wrapped = function () use ($closure) {
|
||||
return $closure($this);
|
||||
|
|
@ -187,6 +193,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
* @param string $alias the alias that should be registered
|
||||
* @param string $target the target that should be resolved instead
|
||||
*/
|
||||
#[\Override]
|
||||
public function registerAlias(string $alias, string $target): void {
|
||||
$this->registerService($alias, function (ContainerInterface $container) use ($target): mixed {
|
||||
return $container->get($target);
|
||||
|
|
@ -222,6 +229,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
/**
|
||||
* @deprecated 20.0.0 use \Psr\Container\ContainerInterface::has
|
||||
*/
|
||||
#[\Override]
|
||||
public function offsetExists($id): bool {
|
||||
return $this->container->offsetExists($id);
|
||||
}
|
||||
|
|
@ -230,6 +238,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
* @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get
|
||||
* @return mixed
|
||||
*/
|
||||
#[\Override]
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($id) {
|
||||
return $this->container->offsetGet($id);
|
||||
|
|
@ -238,6 +247,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
/**
|
||||
* @deprecated 20.0.0 use \OCP\IContainer::registerService
|
||||
*/
|
||||
#[\Override]
|
||||
public function offsetSet($offset, $value): void {
|
||||
$this->container->offsetSet($offset, $value);
|
||||
}
|
||||
|
|
@ -245,6 +255,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
/**
|
||||
* @deprecated 20.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function offsetUnset($offset): void {
|
||||
$this->container->offsetUnset($offset);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class TimeFactory implements ITimeFactory {
|
|||
* @since 8.0.0
|
||||
* @deprecated 26.0.0 {@see ITimeFactory::now()}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getTime(): int {
|
||||
return time();
|
||||
}
|
||||
|
|
@ -40,13 +41,16 @@ class TimeFactory implements ITimeFactory {
|
|||
* @since 15.0.0
|
||||
* @deprecated 26.0.0 {@see ITimeFactory::now()}
|
||||
*/
|
||||
#[\Override]
|
||||
public function getDateTime(string $time = 'now', ?\DateTimeZone $timezone = null): \DateTime {
|
||||
return new \DateTime($time, $timezone);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function now(): \DateTimeImmutable {
|
||||
return new \DateTimeImmutable('now', $this->timezone);
|
||||
}
|
||||
#[\Override]
|
||||
public function withTimeZone(\DateTimeZone $timezone): static {
|
||||
$clone = clone $this;
|
||||
$clone->timezone = $timezone;
|
||||
|
|
@ -54,6 +58,7 @@ class TimeFactory implements ITimeFactory {
|
|||
return $clone;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getTimeZone(?string $timezone = null): \DateTimeZone {
|
||||
if ($timezone !== null) {
|
||||
return new \DateTimeZone($timezone);
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ class TAR extends Archive {
|
|||
/**
|
||||
* add an empty folder to the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function addFolder(string $path): bool {
|
||||
$tmpBase = Server::get(ITempManager::class)->getTemporaryFolder();
|
||||
$path = rtrim($path, '/') . '/';
|
||||
|
|
@ -87,6 +88,7 @@ class TAR extends Archive {
|
|||
*
|
||||
* @param string $source either a local file or string data
|
||||
*/
|
||||
#[\Override]
|
||||
public function addFile(string $path, string $source = ''): bool {
|
||||
if ($this->fileExists($path)) {
|
||||
$this->remove($path);
|
||||
|
|
@ -103,6 +105,7 @@ class TAR extends Archive {
|
|||
/**
|
||||
* rename a file or folder in the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function rename(string $source, string $dest): bool {
|
||||
//no proper way to delete, rename entire archive, rename file and remake archive
|
||||
$tmp = Server::get(ITempManager::class)->getTemporaryFolder();
|
||||
|
|
@ -137,6 +140,7 @@ class TAR extends Archive {
|
|||
/**
|
||||
* get the uncompressed size of a file in the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function filesize(string $path): false|int|float {
|
||||
$stat = $this->getHeader($path);
|
||||
return $stat['size'] ?? false;
|
||||
|
|
@ -147,6 +151,7 @@ class TAR extends Archive {
|
|||
*
|
||||
* @return int|false
|
||||
*/
|
||||
#[\Override]
|
||||
public function mtime(string $path) {
|
||||
$stat = $this->getHeader($path);
|
||||
return $stat['mtime'] ?? false;
|
||||
|
|
@ -155,6 +160,7 @@ class TAR extends Archive {
|
|||
/**
|
||||
* get the files in a folder
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFolder(string $path): array {
|
||||
$files = $this->getFiles();
|
||||
$folderContent = [];
|
||||
|
|
@ -179,6 +185,7 @@ class TAR extends Archive {
|
|||
/**
|
||||
* get all files in the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFiles(): array {
|
||||
if ($this->fileList !== false) {
|
||||
return $this->fileList;
|
||||
|
|
@ -204,6 +211,7 @@ class TAR extends Archive {
|
|||
*
|
||||
* @return string|false
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFile(string $path) {
|
||||
$string = $this->tar->extractInString($path);
|
||||
/** @var ?string $string */
|
||||
|
|
@ -217,6 +225,7 @@ class TAR extends Archive {
|
|||
/**
|
||||
* extract a single file from the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function extractFile(string $path, string $dest): bool {
|
||||
$tmp = Server::get(ITempManager::class)->getTemporaryFolder();
|
||||
if (!$this->fileExists($path)) {
|
||||
|
|
@ -237,6 +246,7 @@ class TAR extends Archive {
|
|||
/**
|
||||
* extract the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function extract(string $dest): bool {
|
||||
return $this->tar->extract($dest);
|
||||
}
|
||||
|
|
@ -244,6 +254,7 @@ class TAR extends Archive {
|
|||
/**
|
||||
* check if a file or folder exists in the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function fileExists(string $path): bool {
|
||||
$files = $this->getFiles();
|
||||
if ((in_array($path, $files)) || (in_array($path . '/', $files))) {
|
||||
|
|
@ -267,6 +278,7 @@ class TAR extends Archive {
|
|||
/**
|
||||
* remove a file or folder from the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function remove(string $path): bool {
|
||||
if (!$this->fileExists($path)) {
|
||||
return false;
|
||||
|
|
@ -288,6 +300,7 @@ class TAR extends Archive {
|
|||
*
|
||||
* @return bool|resource
|
||||
*/
|
||||
#[\Override]
|
||||
public function getStream(string $path, string $mode) {
|
||||
$lastPoint = strrpos($path, '.');
|
||||
if ($lastPoint !== false) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class ZIP extends Archive {
|
|||
* @param string $path
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
public function addFolder(string $path): bool {
|
||||
return $this->zip->addEmptyDir($path);
|
||||
}
|
||||
|
|
@ -41,6 +42,7 @@ class ZIP extends Archive {
|
|||
* add a file to the archive
|
||||
* @param string $source either a local file or string data
|
||||
*/
|
||||
#[\Override]
|
||||
public function addFile(string $path, string $source = ''): bool {
|
||||
if ($source && $source[0] === '/' && file_exists($source)) {
|
||||
$result = $this->zip->addFile($source, $path);
|
||||
|
|
@ -57,6 +59,7 @@ class ZIP extends Archive {
|
|||
/**
|
||||
* rename a file or folder in the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function rename(string $source, string $dest): bool {
|
||||
$source = $this->stripPath($source);
|
||||
$dest = $this->stripPath($dest);
|
||||
|
|
@ -66,6 +69,7 @@ class ZIP extends Archive {
|
|||
/**
|
||||
* get the uncompressed size of a file in the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function filesize(string $path): false|int|float {
|
||||
$stat = $this->zip->statName($path);
|
||||
return $stat['size'] ?? false;
|
||||
|
|
@ -75,6 +79,7 @@ class ZIP extends Archive {
|
|||
* get the last modified time of a file in the archive
|
||||
* @return int|false
|
||||
*/
|
||||
#[\Override]
|
||||
public function mtime(string $path) {
|
||||
return filemtime($this->path);
|
||||
}
|
||||
|
|
@ -82,6 +87,7 @@ class ZIP extends Archive {
|
|||
/**
|
||||
* get the files in a folder
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFolder(string $path): array {
|
||||
// FIXME: multiple calls on getFolder would traverse
|
||||
// the whole file list over and over again
|
||||
|
|
@ -128,6 +134,7 @@ class ZIP extends Archive {
|
|||
/**
|
||||
* get all files in the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFiles(): array {
|
||||
$fileCount = $this->zip->numFiles;
|
||||
$files = [];
|
||||
|
|
@ -141,6 +148,7 @@ class ZIP extends Archive {
|
|||
* get the content of a file
|
||||
* @return string|false
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFile(string $path) {
|
||||
return $this->zip->getFromName($path);
|
||||
}
|
||||
|
|
@ -148,6 +156,7 @@ class ZIP extends Archive {
|
|||
/**
|
||||
* extract a single file from the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function extractFile(string $path, string $dest): bool {
|
||||
$fp = $this->zip->getStream($path);
|
||||
if ($fp === false) {
|
||||
|
|
@ -159,6 +168,7 @@ class ZIP extends Archive {
|
|||
/**
|
||||
* extract the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function extract(string $dest): bool {
|
||||
return $this->zip->extractTo($dest);
|
||||
}
|
||||
|
|
@ -166,6 +176,7 @@ class ZIP extends Archive {
|
|||
/**
|
||||
* check if a file or folder exists in the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function fileExists(string $path): bool {
|
||||
return ($this->zip->locateName($path) !== false) || ($this->zip->locateName($path . '/') !== false);
|
||||
}
|
||||
|
|
@ -173,6 +184,7 @@ class ZIP extends Archive {
|
|||
/**
|
||||
* remove a file or folder from the archive
|
||||
*/
|
||||
#[\Override]
|
||||
public function remove(string $path): bool {
|
||||
if ($this->fileExists($path . '/')) {
|
||||
return $this->zip->deleteName($path . '/');
|
||||
|
|
@ -185,6 +197,7 @@ class ZIP extends Archive {
|
|||
* get a file handler
|
||||
* @return bool|resource
|
||||
*/
|
||||
#[\Override]
|
||||
public function getStream(string $path, string $mode) {
|
||||
if ($mode === 'r' || $mode === 'rb') {
|
||||
return $this->zip->getStream($path);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class ExpiredTokenException extends \OCP\Authentication\Exceptions\ExpiredTokenE
|
|||
parent::__construct($token);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getToken(): IToken {
|
||||
$token = parent::getToken();
|
||||
/** @var IToken $token We know that we passed OC interface from constructor */
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class WipeTokenException extends \OCP\Authentication\Exceptions\WipeTokenExcepti
|
|||
parent::__construct($token);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getToken(): IToken {
|
||||
$token = parent::getToken();
|
||||
/** @var IToken $token We know that we passed OC interface from constructor */
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class LoginFailedListener implements IEventListener {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if (!($event instanceof LoginFailed)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class RemoteWipeActivityListener implements IEventListener {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if ($event instanceof RemoteWipeStarted) {
|
||||
$this->publishActivity('remote_wipe_start', $event->getToken());
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ class RemoteWipeEmailListener implements IEventListener {
|
|||
/**
|
||||
* @param Event $event
|
||||
*/
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if ($event instanceof RemoteWipeStarted) {
|
||||
$uid = $event->getToken()->getUID();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class RemoteWipeNotificationsListener implements IEventListener {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if ($event instanceof RemoteWipeStarted) {
|
||||
$this->sendNotification('remote_wipe_start', $event->getToken());
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class UserDeletedFilesCleanupListener implements IEventListener {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
$user = $event->getUser();
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class UserDeletedStoreCleanupListener implements IEventListener {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if (!($event instanceof UserDeletedEvent)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class UserDeletedTokenCleanupListener implements IEventListener {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if (!($event instanceof UserDeletedEvent)) {
|
||||
// Unrelated
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class UserDeletedWebAuthnCleanupListener implements IEventListener {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if (!($event instanceof UserDeletedEvent)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class UserLoggedInListener implements IEventListener {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if (!($event instanceof PostLoginEvent)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class ClearLostPasswordTokensCommand extends ALoginCommand {
|
|||
/**
|
||||
* User has successfully logged in, now remove the password reset link, when it is available
|
||||
*/
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
$this->config->deleteUserValue(
|
||||
$loginData->getUser()->getUID(),
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class CompleteLoginCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
$this->userSession->completeLogin(
|
||||
$loginData->getUser(),
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class CreateSessionTokenCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
if ($this->config->getSystemValueInt('remember_login_cookie_lifetime', 60 * 60 * 24 * 15) === 0) {
|
||||
$loginData->setRememberLogin(false);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class FinishRememberedLoginCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
if ($loginData->isRememberLogin() && !$this->config->getSystemValueBool('auto_logout', false)) {
|
||||
$this->userSession->createRememberMeToken($loginData->getUser());
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class FlowV2EphemeralSessionsCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
$loginV2GrantRoute = $this->urlGenerator->linkToRoute('core.ClientFlowLoginV2.grantPage');
|
||||
if (str_starts_with($loginData->getRedirectUrl() ?? '', $loginV2GrantRoute)) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class LoggedInCheckCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
if ($loginData->getUser() === false) {
|
||||
$loginName = $loginData->getUsername();
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ class PreLoginHookCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
if ($this->userManager instanceof PublicEmitter) {
|
||||
$this->userManager->emit(
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class SetUserTimezoneCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
if ($loginData->getTimeZoneOffset() !== '' && $this->isValidTimezone($loginData->getTimeZone())) {
|
||||
$userId = $loginData->getUser()->getUID();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class TwoFactorCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
if (!$this->twoFactorManager->isTwoFactorAuthenticated($loginData->getUser())) {
|
||||
return $this->processNextOrFinishSuccessfully($loginData);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class UidLoginCommand extends ALoginCommand {
|
|||
*
|
||||
* @return LoginResult
|
||||
*/
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
/* @var $loginResult IUser */
|
||||
$user = $this->userManager->checkPasswordNoLogging(
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class UpdateLastPasswordConfirmCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
$this->session->set(
|
||||
'last-password-confirm',
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class UserDisabledCheckCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
$user = $this->userManager->get($loginData->getUsername());
|
||||
if ($user !== null && $user->isEnabled() === false) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class WebAuthnLoginCommand extends ALoginCommand {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
$user = $this->userManager->get($loginData->getUsername());
|
||||
$loginData->setUser($user);
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ class Store implements IStore {
|
|||
* @return ICredentials the login credentials of the current user
|
||||
* @throws CredentialsUnavailableException
|
||||
*/
|
||||
#[\Override]
|
||||
public function getLoginCredentials(): ICredentials {
|
||||
if ($this->tokenProvider === null) {
|
||||
throw new CredentialsUnavailableException();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class Notifier implements INotifier {
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
#[\Override]
|
||||
public function prepare(INotification $notification, string $languageCode): INotification {
|
||||
if ($notification->getApp() !== 'auth') {
|
||||
// Not my app => throw
|
||||
|
|
@ -60,6 +61,7 @@ class Notifier implements INotifier {
|
|||
* @return string
|
||||
* @since 17.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getID(): string {
|
||||
return 'auth';
|
||||
}
|
||||
|
|
@ -70,6 +72,7 @@ class Notifier implements INotifier {
|
|||
* @return string
|
||||
* @since 17.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getName(): string {
|
||||
return $this->factory->get('lib')->t('Authentication');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class Manager implements IProvider, OCPIProvider {
|
|||
* @param int $remember whether the session token should be used for remember-me
|
||||
* @return OCPIToken
|
||||
*/
|
||||
#[\Override]
|
||||
public function generateToken(string $token,
|
||||
string $uid,
|
||||
string $loginName,
|
||||
|
|
@ -82,6 +83,7 @@ class Manager implements IProvider, OCPIProvider {
|
|||
* @param OCPIToken $token
|
||||
* @throws InvalidTokenException
|
||||
*/
|
||||
#[\Override]
|
||||
public function updateToken(OCPIToken $token) {
|
||||
$provider = $this->getProvider($token);
|
||||
$provider->updateToken($token);
|
||||
|
|
@ -93,6 +95,7 @@ class Manager implements IProvider, OCPIProvider {
|
|||
* @throws InvalidTokenException
|
||||
* @param OCPIToken $token
|
||||
*/
|
||||
#[\Override]
|
||||
public function updateTokenActivity(OCPIToken $token) {
|
||||
$provider = $this->getProvider($token);
|
||||
$provider->updateTokenActivity($token);
|
||||
|
|
@ -102,6 +105,7 @@ class Manager implements IProvider, OCPIProvider {
|
|||
* @param string $uid
|
||||
* @return OCPIToken[]
|
||||
*/
|
||||
#[\Override]
|
||||
public function getTokenByUser(string $uid): array {
|
||||
return $this->publicKeyTokenProvider->getTokenByUser($uid);
|
||||
}
|
||||
|
|
@ -114,6 +118,7 @@ class Manager implements IProvider, OCPIProvider {
|
|||
* @throws \RuntimeException when OpenSSL reports a problem
|
||||
* @return OCPIToken
|
||||
*/
|
||||
#[\Override]
|
||||
public function getToken(string $tokenId): OCPIToken {
|
||||
try {
|
||||
return $this->publicKeyTokenProvider->getToken($tokenId);
|
||||
|
|
@ -133,6 +138,7 @@ class Manager implements IProvider, OCPIProvider {
|
|||
* @throws InvalidTokenException
|
||||
* @return OCPIToken
|
||||
*/
|
||||
#[\Override]
|
||||
public function getTokenById(int $tokenId): OCPIToken {
|
||||
try {
|
||||
return $this->publicKeyTokenProvider->getTokenById($tokenId);
|
||||
|
|
@ -151,6 +157,7 @@ class Manager implements IProvider, OCPIProvider {
|
|||
* @throws InvalidTokenException
|
||||
* @return OCPIToken
|
||||
*/
|
||||
#[\Override]
|
||||
public function renewSessionToken(string $oldSessionId, string $sessionId): OCPIToken {
|
||||
try {
|
||||
return $this->publicKeyTokenProvider->renewSessionToken($oldSessionId, $sessionId);
|
||||
|
|
@ -168,28 +175,34 @@ class Manager implements IProvider, OCPIProvider {
|
|||
* @throws PasswordlessTokenException
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getPassword(OCPIToken $savedToken, string $tokenId): string {
|
||||
$provider = $this->getProvider($savedToken);
|
||||
return $provider->getPassword($savedToken, $tokenId);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setPassword(OCPIToken $token, string $tokenId, string $password) {
|
||||
$provider = $this->getProvider($token);
|
||||
$provider->setPassword($token, $tokenId, $password);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function invalidateToken(string $token) {
|
||||
$this->publicKeyTokenProvider->invalidateToken($token);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function invalidateTokenById(string $uid, int $id) {
|
||||
$this->publicKeyTokenProvider->invalidateTokenById($uid, $id);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function invalidateOldTokens() {
|
||||
$this->publicKeyTokenProvider->invalidateOldTokens();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function invalidateLastUsedBefore(string $uid, int $before): void {
|
||||
$this->publicKeyTokenProvider->invalidateLastUsedBefore($uid, $before);
|
||||
}
|
||||
|
|
@ -202,6 +215,7 @@ class Manager implements IProvider, OCPIProvider {
|
|||
* @throws InvalidTokenException
|
||||
* @throws \RuntimeException when OpenSSL reports a problem
|
||||
*/
|
||||
#[\Override]
|
||||
public function rotate(OCPIToken $token, string $oldTokenId, string $newTokenId): OCPIToken {
|
||||
if ($token instanceof PublicKeyToken) {
|
||||
return $this->publicKeyTokenProvider->rotate($token, $oldTokenId, $newTokenId);
|
||||
|
|
@ -225,14 +239,17 @@ class Manager implements IProvider, OCPIProvider {
|
|||
}
|
||||
|
||||
|
||||
#[\Override]
|
||||
public function markPasswordInvalid(OCPIToken $token, string $tokenId) {
|
||||
$this->getProvider($token)->markPasswordInvalid($token, $tokenId);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function updatePasswords(string $uid, string $password) {
|
||||
$this->publicKeyTokenProvider->updatePasswords($uid, $password);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function invalidateTokensOfUser(string $uid, ?string $clientName) {
|
||||
$tokens = $this->getTokenByUser($uid);
|
||||
foreach ($tokens as $token) {
|
||||
|
|
|
|||
|
|
@ -101,11 +101,13 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
|
|||
$this->addType('passwordInvalid', Types::BOOLEAN);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getId(): int {
|
||||
assert(!is_string($this->id) && $this->id !== null);
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getUID(): string {
|
||||
return $this->uid;
|
||||
}
|
||||
|
|
@ -115,6 +117,7 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
public function getLoginName(): string {
|
||||
return parent::getLoginName();
|
||||
}
|
||||
|
|
@ -122,10 +125,12 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
|
|||
/**
|
||||
* Get the (encrypted) login password
|
||||
*/
|
||||
#[\Override]
|
||||
public function getPassword(): ?string {
|
||||
return parent::getPassword();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function jsonSerialize(): array {
|
||||
return [
|
||||
'id' => $this->id,
|
||||
|
|
@ -141,6 +146,7 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
|
|||
*
|
||||
* @return int
|
||||
*/
|
||||
#[\Override]
|
||||
public function getLastCheck(): int {
|
||||
return parent::getLastCheck();
|
||||
}
|
||||
|
|
@ -148,10 +154,12 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
|
|||
/**
|
||||
* Get the timestamp of the last password check
|
||||
*/
|
||||
#[\Override]
|
||||
public function setLastCheck(int $time): void {
|
||||
parent::setLastCheck($time);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getScope(): string {
|
||||
$scope = parent::getScope();
|
||||
if ($scope === null) {
|
||||
|
|
@ -161,6 +169,7 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
|
|||
return $scope;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getScopeAsArray(): array {
|
||||
$scope = json_decode($this->getScope(), true);
|
||||
if (!$scope) {
|
||||
|
|
@ -171,6 +180,7 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
|
|||
return $scope;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setScope(array|string|null $scope): void {
|
||||
if (is_array($scope)) {
|
||||
parent::setScope(json_encode($scope));
|
||||
|
|
@ -179,26 +189,32 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getName(): string {
|
||||
return parent::getName();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setName(string $name): void {
|
||||
parent::setName($name);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getRemember(): int {
|
||||
return parent::getRemember();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setToken(string $token): void {
|
||||
parent::setToken($token);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setPassword(?string $password = null): void {
|
||||
parent::setPassword($password);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setExpires($expires): void {
|
||||
parent::setExpires($expires);
|
||||
}
|
||||
|
|
@ -214,6 +230,7 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken {
|
|||
parent::setPasswordInvalid($invalid);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function wipe(): void {
|
||||
parent::setType(IToken::WIPE_TOKEN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function generateToken(string $token,
|
||||
string $uid,
|
||||
string $loginName,
|
||||
|
|
@ -102,6 +103,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
return $dbToken;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getToken(string $tokenId): OCPIToken {
|
||||
/**
|
||||
* Token length: 72
|
||||
|
|
@ -177,6 +179,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
$this->cache->set($tokenHash, false, self::TOKEN_CACHE_TTL * 2);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getTokenById(int $tokenId): OCPIToken {
|
||||
try {
|
||||
$token = $this->mapper->getTokenById($tokenId);
|
||||
|
|
@ -204,6 +207,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function renewSessionToken(string $oldSessionId, string $sessionId): OCPIToken {
|
||||
return $this->atomic(function () use ($oldSessionId, $sessionId) {
|
||||
$token = $this->getToken($oldSessionId);
|
||||
|
|
@ -238,6 +242,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
}, $this->db);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function invalidateToken(string $token) {
|
||||
$tokenHash = $this->hashToken($token);
|
||||
$tokenEntry = null;
|
||||
|
|
@ -253,6 +258,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function invalidateTokenById(string $uid, int $id) {
|
||||
$token = $this->mapper->getTokenById($id);
|
||||
if ($token->getUID() !== $uid) {
|
||||
|
|
@ -263,6 +269,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
$this->eventDispatcher->dispatchTyped(new TokenInvalidatedEvent($token));
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function invalidateOldTokens() {
|
||||
$olderThan = $this->time->getTime() - $this->config->getSystemValueInt('session_lifetime', 60 * 60 * 24);
|
||||
$this->logger->debug('Invalidating session tokens older than ' . date('c', $olderThan), ['app' => 'cron']);
|
||||
|
|
@ -281,10 +288,12 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
$this->mapper->invalidateOld($authTokenThreshold, OCPIToken::PERMANENT_TOKEN);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function invalidateLastUsedBefore(string $uid, int $before): void {
|
||||
$this->mapper->invalidateLastUsedBefore($uid, $before);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function updateToken(OCPIToken $token) {
|
||||
if (!($token instanceof PublicKeyToken)) {
|
||||
throw new InvalidTokenException('Invalid token type');
|
||||
|
|
@ -293,6 +302,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
$this->cacheToken($token);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function updateTokenActivity(OCPIToken $token) {
|
||||
if (!($token instanceof PublicKeyToken)) {
|
||||
throw new InvalidTokenException('Invalid token type');
|
||||
|
|
@ -310,10 +320,12 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getTokenByUser(string $uid): array {
|
||||
return $this->mapper->getTokenByUser($uid);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getPassword(OCPIToken $savedToken, string $tokenId): string {
|
||||
if (!($savedToken instanceof PublicKeyToken)) {
|
||||
throw new InvalidTokenException('Invalid token type');
|
||||
|
|
@ -330,6 +342,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
return $this->decryptPassword($savedToken->getPassword(), $privateKey);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setPassword(OCPIToken $token, string $tokenId, string $password) {
|
||||
if (!($token instanceof PublicKeyToken)) {
|
||||
throw new InvalidTokenException('Invalid token type');
|
||||
|
|
@ -355,6 +368,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
return $this->hasher->hash(sha1($password) . $password);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function rotate(OCPIToken $token, string $oldTokenId, string $newTokenId): OCPIToken {
|
||||
if (!($token instanceof PublicKeyToken)) {
|
||||
throw new InvalidTokenException('Invalid token type');
|
||||
|
|
@ -484,6 +498,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
return $dbToken;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function markPasswordInvalid(OCPIToken $token, string $tokenId) {
|
||||
if (!($token instanceof PublicKeyToken)) {
|
||||
throw new InvalidTokenException('Invalid token type');
|
||||
|
|
@ -494,6 +509,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
$this->cacheToken($token);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function updatePasswords(string $uid, string $password) {
|
||||
// prevent setting an empty pw as result of pw-less-login
|
||||
if ($password === '' || !$this->config->getSystemValueBool('auth.storeCryptedPassword', true)) {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class TokenCleanupJob extends TimedJob {
|
|||
$this->setTimeSensitivity(self::TIME_INSENSITIVE);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function run($argument) {
|
||||
$this->provider->invalidateOldTokens();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ class EnforcementState implements JsonSerializable {
|
|||
return $this->excludedGroups;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function jsonSerialize(): array {
|
||||
return [
|
||||
'enforced' => $this->enforced,
|
||||
|
|
|
|||
|
|
@ -26,10 +26,12 @@ class Registry implements IRegistry {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getProviderStates(IUser $user): array {
|
||||
return $this->assignmentDao->getState($user->getUID());
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function enableProviderFor(IProvider $provider, IUser $user) {
|
||||
$this->assignmentDao->persist($provider->getId(), $user->getUID(), 1);
|
||||
|
||||
|
|
@ -38,6 +40,7 @@ class Registry implements IRegistry {
|
|||
$this->dispatcher->dispatchTyped(new TwoFactorProviderForUserRegistered($user, $provider));
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function disableProviderFor(IProvider $provider, IUser $user) {
|
||||
$this->assignmentDao->persist($provider->getId(), $user->getUID(), 0);
|
||||
|
||||
|
|
@ -54,6 +57,7 @@ class Registry implements IRegistry {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function cleanUp(string $providerId) {
|
||||
$this->assignmentDao->deleteAll($providerId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class CredentialRepository implements PublicKeyCredentialSourceRepository {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function findOneByCredentialId(string $publicKeyCredentialId): ?PublicKeyCredentialSource {
|
||||
try {
|
||||
$entity = $this->credentialMapper->findOneByCredentialId($publicKeyCredentialId);
|
||||
|
|
@ -33,6 +34,7 @@ class CredentialRepository implements PublicKeyCredentialSourceRepository {
|
|||
/**
|
||||
* @return PublicKeyCredentialSource[]
|
||||
*/
|
||||
#[\Override]
|
||||
public function findAllForUserEntity(PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity): array {
|
||||
$uid = $publicKeyCredentialUserEntity->getId();
|
||||
$entities = $this->credentialMapper->findAllForUid($uid);
|
||||
|
|
@ -73,6 +75,7 @@ class CredentialRepository implements PublicKeyCredentialSourceRepository {
|
|||
return $this->credentialMapper->insertOrUpdate($entity);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource, ?string $name = null): void {
|
||||
$this->saveAndReturnCredentialSource($publicKeyCredentialSource, $name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class PublicKeyCredentialEntity extends Entity implements JsonSerializable {
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
#[\Override]
|
||||
public function jsonSerialize(): array {
|
||||
return [
|
||||
'id' => $this->getId(),
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ abstract class Avatar implements IAvatar {
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
#[\Override]
|
||||
public function get(int $size = 64, bool $darkTheme = false) {
|
||||
try {
|
||||
$file = $this->getFile($size, $darkTheme);
|
||||
|
|
@ -254,6 +255,7 @@ abstract class Avatar implements IAvatar {
|
|||
/**
|
||||
* @return Color Object containing r g b int in the range [0, 255]
|
||||
*/
|
||||
#[\Override]
|
||||
public function avatarBackgroundColor(string $hash): Color {
|
||||
// Normalize hash
|
||||
$hash = strtolower($hash);
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class AvatarManager implements IAvatarManager {
|
|||
* @throws \Exception In case the username is potentially dangerous
|
||||
* @throws NotFoundException In case there is no user folder yet
|
||||
*/
|
||||
#[\Override]
|
||||
public function getAvatar(string $userId): IAvatar {
|
||||
$user = $this->userManager->get($userId);
|
||||
if ($user === null) {
|
||||
|
|
@ -128,6 +129,7 @@ class AvatarManager implements IAvatarManager {
|
|||
*
|
||||
* @param string $name The guest name, e.g. "Albert".
|
||||
*/
|
||||
#[\Override]
|
||||
public function getGuestAvatar(string $name): IAvatar {
|
||||
return new GuestAvatar($name, $this->config, $this->logger);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class GuestAvatar extends Avatar {
|
|||
/**
|
||||
* Tests if the user has an avatar.
|
||||
*/
|
||||
#[\Override]
|
||||
public function exists(): bool {
|
||||
// Guests always have an avatar.
|
||||
return true;
|
||||
|
|
@ -43,6 +44,7 @@ class GuestAvatar extends Avatar {
|
|||
/**
|
||||
* Returns the guest user display name.
|
||||
*/
|
||||
#[\Override]
|
||||
public function getDisplayName(): string {
|
||||
return $this->userDisplayName;
|
||||
}
|
||||
|
|
@ -52,6 +54,7 @@ class GuestAvatar extends Avatar {
|
|||
*
|
||||
* @param IImage|resource|string $data
|
||||
*/
|
||||
#[\Override]
|
||||
public function set($data): void {
|
||||
// unimplemented for guest user avatars
|
||||
}
|
||||
|
|
@ -59,6 +62,7 @@ class GuestAvatar extends Avatar {
|
|||
/**
|
||||
* Removing avatars isn't implemented for guests.
|
||||
*/
|
||||
#[\Override]
|
||||
public function remove(bool $silent = false): void {
|
||||
// unimplemented for guest user avatars
|
||||
}
|
||||
|
|
@ -66,6 +70,7 @@ class GuestAvatar extends Avatar {
|
|||
/**
|
||||
* Generates an avatar for the guest.
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFile(int $size, bool $darkTheme = false): ISimpleFile {
|
||||
$avatar = $this->generateAvatar($this->userDisplayName, $size, $darkTheme);
|
||||
return new InMemoryFile('avatar.png', $avatar);
|
||||
|
|
@ -78,6 +83,7 @@ class GuestAvatar extends Avatar {
|
|||
* @param mixed $oldValue The previous value
|
||||
* @param mixed $newValue The new value
|
||||
*/
|
||||
#[\Override]
|
||||
public function userChanged(string $feature, $oldValue, $newValue): void {
|
||||
if ($feature === 'displayName') {
|
||||
$this->userDisplayName = $newValue;
|
||||
|
|
@ -87,6 +93,7 @@ class GuestAvatar extends Avatar {
|
|||
/**
|
||||
* Guests don't have custom avatars.
|
||||
*/
|
||||
#[\Override]
|
||||
public function isCustomAvatar(): bool {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -96,6 +103,7 @@ class GuestAvatar extends Avatar {
|
|||
* Different color than for authorized user with the same name
|
||||
* to make it harder to impersonate people.
|
||||
*/
|
||||
#[\Override]
|
||||
public function avatarBackgroundColor(string $hash): Color {
|
||||
return parent::avatarBackgroundColor($hash . ' (guest)');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ class PlaceholderAvatar extends Avatar {
|
|||
/**
|
||||
* Check if an avatar exists for the user
|
||||
*/
|
||||
#[\Override]
|
||||
public function exists(): bool {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -50,6 +51,7 @@ class PlaceholderAvatar extends Avatar {
|
|||
* @throws \Exception if the provided image is not valid
|
||||
* @throws NotSquareException if the image is not square
|
||||
*/
|
||||
#[\Override]
|
||||
public function set($data): void {
|
||||
// unimplemented for placeholder avatars
|
||||
}
|
||||
|
|
@ -57,6 +59,7 @@ class PlaceholderAvatar extends Avatar {
|
|||
/**
|
||||
* Removes the users avatar.
|
||||
*/
|
||||
#[\Override]
|
||||
public function remove(bool $silent = false): void {
|
||||
$avatars = $this->folder->getDirectoryListing();
|
||||
|
||||
|
|
@ -74,6 +77,7 @@ class PlaceholderAvatar extends Avatar {
|
|||
* @throws NotPermittedException
|
||||
* @throws PreConditionNotMetException
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFile(int $size, bool $darkTheme = false): ISimpleFile {
|
||||
$ext = 'png';
|
||||
|
||||
|
|
@ -110,6 +114,7 @@ class PlaceholderAvatar extends Avatar {
|
|||
/**
|
||||
* Returns the user display name.
|
||||
*/
|
||||
#[\Override]
|
||||
public function getDisplayName(): string {
|
||||
return $this->user->getDisplayName();
|
||||
}
|
||||
|
|
@ -123,6 +128,7 @@ class PlaceholderAvatar extends Avatar {
|
|||
* @throws NotPermittedException
|
||||
* @throws PreConditionNotMetException
|
||||
*/
|
||||
#[\Override]
|
||||
public function userChanged(string $feature, $oldValue, $newValue): void {
|
||||
$this->remove();
|
||||
}
|
||||
|
|
@ -130,6 +136,7 @@ class PlaceholderAvatar extends Avatar {
|
|||
/**
|
||||
* Check if the avatar of a user is a custom uploaded one
|
||||
*/
|
||||
#[\Override]
|
||||
public function isCustomAvatar(): bool {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ class UserAvatar extends Avatar {
|
|||
/**
|
||||
* Check if an avatar exists for the user
|
||||
*/
|
||||
#[\Override]
|
||||
public function exists(): bool {
|
||||
return $this->folder->fileExists('avatar.jpg') || $this->folder->fileExists('avatar.png');
|
||||
}
|
||||
|
|
@ -50,6 +51,7 @@ class UserAvatar extends Avatar {
|
|||
* @throws \Exception if the provided image is not valid
|
||||
* @throws NotSquareException if the image is not square
|
||||
*/
|
||||
#[\Override]
|
||||
public function set($data): void {
|
||||
$img = $this->getAvatarImage($data);
|
||||
$data = $img->data();
|
||||
|
|
@ -150,6 +152,7 @@ class UserAvatar extends Avatar {
|
|||
* @throws NotPermittedException
|
||||
* @throws PreConditionNotMetException
|
||||
*/
|
||||
#[\Override]
|
||||
public function remove(bool $silent = false): void {
|
||||
$avatars = $this->folder->getDirectoryListing();
|
||||
|
||||
|
|
@ -197,6 +200,7 @@ class UserAvatar extends Avatar {
|
|||
* @throws NotPermittedException
|
||||
* @throws PreConditionNotMetException
|
||||
*/
|
||||
#[\Override]
|
||||
public function getFile(int $size, bool $darkTheme = false): ISimpleFile {
|
||||
$generated = $this->folder->fileExists('generated');
|
||||
|
||||
|
|
@ -269,6 +273,7 @@ class UserAvatar extends Avatar {
|
|||
/**
|
||||
* Returns the user display name.
|
||||
*/
|
||||
#[\Override]
|
||||
public function getDisplayName(): string {
|
||||
return $this->user->getDisplayName();
|
||||
}
|
||||
|
|
@ -282,6 +287,7 @@ class UserAvatar extends Avatar {
|
|||
* @throws NotPermittedException
|
||||
* @throws PreConditionNotMetException
|
||||
*/
|
||||
#[\Override]
|
||||
public function userChanged(string $feature, $oldValue, $newValue): void {
|
||||
// If the avatar is not generated (so an uploaded image) we skip this
|
||||
if (!$this->folder->fileExists('generated')) {
|
||||
|
|
@ -294,6 +300,7 @@ class UserAvatar extends Avatar {
|
|||
/**
|
||||
* Check if the avatar of a user is a custom uploaded one
|
||||
*/
|
||||
#[\Override]
|
||||
public function isCustomAvatar(): bool {
|
||||
return $this->config->getUserValue($this->user->getUID(), 'avatar', 'generated', 'false') !== 'true';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ class JobList implements IJobList {
|
|||
$query->executeStatement();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function scheduleAfter(string $job, int $runAfter, mixed $argument = null): void {
|
||||
$this->add($job, $argument, $runAfter);
|
||||
}
|
||||
|
|
@ -346,6 +347,7 @@ class JobList implements IJobList {
|
|||
/**
|
||||
* set the job that was last ran
|
||||
*/
|
||||
#[\Override]
|
||||
public function setLastJob(IJob $job): void {
|
||||
$this->unlockJob($job);
|
||||
$this->config->setAppValue('backgroundjob', 'lastjob', $job->getId());
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ class BinaryFinder implements IBinaryFinder {
|
|||
*
|
||||
* @return false|string
|
||||
*/
|
||||
#[\Override]
|
||||
public function findBinaryPath(string $program) {
|
||||
$result = $this->cache->get($program);
|
||||
if ($result !== null) {
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ class GenerateBlurhashMetadata implements IEventListener {
|
|||
* @throws GenericFileException
|
||||
* @throws LockedException
|
||||
*/
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if (!($event instanceof MetadataLiveEvent)
|
||||
&& !($event instanceof MetadataBackgroundEvent)) {
|
||||
|
|
|
|||
|
|
@ -20,18 +20,22 @@ class BroadcastEvent extends Event implements IBroadcastEvent {
|
|||
parent::__construct();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getName(): string {
|
||||
return $this->event->broadcastAs();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getUids(): array {
|
||||
return $this->event->getUids();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getPayload(): JsonSerializable {
|
||||
return $this->event;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setBroadcasted(): void {
|
||||
$this->event->setBroadcasted();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ class File implements ICache {
|
|||
* @return mixed|null
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
#[\Override]
|
||||
public function get($key) {
|
||||
$result = null;
|
||||
if ($this->hasKey($key)) {
|
||||
|
|
@ -87,6 +88,7 @@ class File implements ICache {
|
|||
* @return bool|mixed
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
#[\Override]
|
||||
public function set($key, $value, $ttl = 0) {
|
||||
$storage = $this->getStorage();
|
||||
$result = false;
|
||||
|
|
@ -114,6 +116,7 @@ class File implements ICache {
|
|||
* @return bool
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
#[\Override]
|
||||
public function hasKey($key) {
|
||||
$storage = $this->getStorage();
|
||||
if ($storage && $storage->is_file($key) && $storage->isReadable($key)) {
|
||||
|
|
@ -127,6 +130,7 @@ class File implements ICache {
|
|||
* @return bool|mixed
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
#[\Override]
|
||||
public function remove($key) {
|
||||
$storage = $this->getStorage();
|
||||
if (!$storage) {
|
||||
|
|
@ -140,6 +144,7 @@ class File implements ICache {
|
|||
* @return bool
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
#[\Override]
|
||||
public function clear($prefix = '') {
|
||||
$storage = $this->getStorage();
|
||||
if ($storage && $storage->is_dir('/')) {
|
||||
|
|
@ -189,6 +194,7 @@ class File implements ICache {
|
|||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public static function isAvailable(): bool {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,12 @@ class AvailabilityResult implements IAvailabilityResult {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getAttendeeEmail(): string {
|
||||
return $this->attendee;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function isAvailable(): bool {
|
||||
return $this->available;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,46 +34,55 @@ class CalendarEventBuilder implements ICalendarEventBuilder {
|
|||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setStartDate(DateTimeInterface $start): ICalendarEventBuilder {
|
||||
$this->startDate = $start;
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setEndDate(DateTimeInterface $end): ICalendarEventBuilder {
|
||||
$this->endDate = $end;
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setSummary(string $summary): ICalendarEventBuilder {
|
||||
$this->summary = $summary;
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setDescription(string $description): ICalendarEventBuilder {
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setLocation(string $location): ICalendarEventBuilder {
|
||||
$this->location = $location;
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setStatus(CalendarEventStatus $status): static {
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setOrganizer(string $email, ?string $commonName = null): ICalendarEventBuilder {
|
||||
$this->organizer = [$email, $commonName];
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function addAttendee(string $email, ?string $commonName = null): ICalendarEventBuilder {
|
||||
$this->attendees[] = [$email, $commonName];
|
||||
return $this;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function toIcs(): string {
|
||||
if ($this->startDate === null) {
|
||||
throw new InvalidArgumentException('Event is missing a start date');
|
||||
|
|
@ -117,6 +126,7 @@ class CalendarEventBuilder implements ICalendarEventBuilder {
|
|||
return $vcalendar->serialize();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function createInCalendar(ICreateFromString $calendar): string {
|
||||
$fileName = $this->uid . '.ics';
|
||||
$calendar->createFromString($fileName, $this->toIcs());
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class CalendarQuery implements ICalendarQuery {
|
|||
$this->principalUri = $principalUri;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setSearchPattern(string $pattern): void {
|
||||
$this->searchPattern = $pattern;
|
||||
}
|
||||
|
|
@ -47,6 +48,7 @@ class CalendarQuery implements ICalendarQuery {
|
|||
return $this->searchPattern;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function addSearchProperty(string $value): void {
|
||||
$this->searchProperties[] = $value;
|
||||
}
|
||||
|
|
@ -55,6 +57,7 @@ class CalendarQuery implements ICalendarQuery {
|
|||
return $this->searchProperties;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function addSearchCalendar(string $calendarUri): void {
|
||||
$this->calendarUris[] = $calendarUri;
|
||||
}
|
||||
|
|
@ -70,6 +73,7 @@ class CalendarQuery implements ICalendarQuery {
|
|||
return $this->limit;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setLimit(int $limit): void {
|
||||
$this->limit = $limit;
|
||||
}
|
||||
|
|
@ -78,18 +82,22 @@ class CalendarQuery implements ICalendarQuery {
|
|||
return $this->offset;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setOffset(int $offset): void {
|
||||
$this->offset = $offset;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function addType(string $value): void {
|
||||
$this->options['types'][] = $value;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setTimerangeStart(\DateTimeImmutable $startTime): void {
|
||||
$this->options['timerange']['start'] = $startTime;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function setTimerangeEnd(\DateTimeImmutable $endTime): void {
|
||||
$this->options['timerange']['end'] = $endTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ class Manager implements IManager {
|
|||
* @return array an array of events/journals/todos which are arrays of arrays of key-value-pairs
|
||||
* @since 13.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function search(
|
||||
$pattern,
|
||||
array $searchProperties = [],
|
||||
|
|
@ -102,6 +103,7 @@ class Manager implements IManager {
|
|||
* @return bool true if enabled, false if not
|
||||
* @since 13.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function isEnabled(): bool {
|
||||
return !empty($this->calendars) || !empty($this->calendarLoaders);
|
||||
}
|
||||
|
|
@ -111,6 +113,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @since 13.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function registerCalendar(ICalendar $calendar): void {
|
||||
$this->calendars[$calendar->getKey()] = $calendar;
|
||||
}
|
||||
|
|
@ -120,6 +123,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @since 13.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function unregisterCalendar(ICalendar $calendar): void {
|
||||
unset($this->calendars[$calendar->getKey()]);
|
||||
}
|
||||
|
|
@ -130,6 +134,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @since 13.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function register(\Closure $callable): void {
|
||||
$this->calendarLoaders[] = $callable;
|
||||
}
|
||||
|
|
@ -139,6 +144,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @since 13.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getCalendars(): array {
|
||||
$this->loadCalendars();
|
||||
|
||||
|
|
@ -150,6 +156,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @since 13.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function clear(): void {
|
||||
$this->calendars = [];
|
||||
$this->calendarLoaders = [];
|
||||
|
|
@ -168,6 +175,7 @@ class Manager implements IManager {
|
|||
/**
|
||||
* @return ICreateFromString[]
|
||||
*/
|
||||
#[\Override]
|
||||
public function getCalendarsForPrincipal(string $principalUri, array $calendarUris = []): array {
|
||||
$context = $this->coordinator->getRegistrationContext();
|
||||
if ($context === null) {
|
||||
|
|
@ -191,6 +199,7 @@ class Manager implements IManager {
|
|||
);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function searchForPrincipal(ICalendarQuery $query): array {
|
||||
/** @var CalendarQuery $query */
|
||||
$calendars = $this->getCalendarsForPrincipal(
|
||||
|
|
@ -217,6 +226,7 @@ class Manager implements IManager {
|
|||
return $results;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function newQuery(string $principalUri): ICalendarQuery {
|
||||
return new CalendarQuery($principalUri);
|
||||
}
|
||||
|
|
@ -226,6 +236,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
#[\Override]
|
||||
public function handleIMip(
|
||||
string $userId,
|
||||
string $message,
|
||||
|
|
@ -351,6 +362,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
#[\Override]
|
||||
public function handleIMipRequest(
|
||||
string $principalUri,
|
||||
string $sender,
|
||||
|
|
@ -371,6 +383,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
#[\Override]
|
||||
public function handleIMipReply(
|
||||
string $principalUri,
|
||||
string $sender,
|
||||
|
|
@ -391,6 +404,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
#[\Override]
|
||||
public function handleIMipCancel(
|
||||
string $principalUri,
|
||||
string $sender,
|
||||
|
|
@ -407,11 +421,13 @@ class Manager implements IManager {
|
|||
return $this->handleIMip($userId, $calendarData, $options);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function createEventBuilder(): ICalendarEventBuilder {
|
||||
$uid = $this->random->generate(32, ISecureRandom::CHAR_ALPHANUMERIC);
|
||||
return new CalendarEventBuilder($uid, $this->timeFactory);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function checkAvailability(
|
||||
DateTimeInterface $start,
|
||||
DateTimeInterface $end,
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @since 14.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function registerBackend(string $backendClass): void {
|
||||
$this->backends[$backendClass] = $backendClass;
|
||||
}
|
||||
|
|
@ -48,6 +49,7 @@ class Manager implements IManager {
|
|||
*
|
||||
* @since 14.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function unregisterBackend(string $backendClass): void {
|
||||
unset($this->backends[$backendClass], $this->initializedBackends[$backendClass]);
|
||||
}
|
||||
|
|
@ -73,6 +75,7 @@ class Manager implements IManager {
|
|||
* @throws QueryException
|
||||
* @since 14.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function getBackends():array {
|
||||
$this->fetchBootstrapBackends();
|
||||
|
||||
|
|
@ -91,6 +94,7 @@ class Manager implements IManager {
|
|||
* @param string $backendId
|
||||
* @throws QueryException
|
||||
*/
|
||||
#[\Override]
|
||||
public function getBackend($backendId): ?IBackend {
|
||||
$backends = $this->getBackends();
|
||||
foreach ($backends as $backend) {
|
||||
|
|
@ -107,11 +111,13 @@ class Manager implements IManager {
|
|||
*
|
||||
* @since 14.0.0
|
||||
*/
|
||||
#[\Override]
|
||||
public function clear(): void {
|
||||
$this->backends = [];
|
||||
$this->initializedBackends = [];
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function update(): void {
|
||||
$this->updater->updateResources();
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue