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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"psalm": "psalm.phar --threads=1",
"psalm:update-baseline": "psalm.phar --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml",
"psalm:clear": "psalm.phar --clear-cache && psalm.phar--clear-global-cache",
"psalm:fix": "psalm.phar --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"psalm": "vendor-bin/psalm/vendor/vimeo/psalm/psalm --threads=1",
"psalm:update-baseline": "vendor-bin/psalm/vendor/vimeo/psalm/psalm --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml",
"test:unit": "phpunit -c tests/phpunit.xml --color --fail-on-warning --fail-on-risky",
"post-install-cmd": [
"[ $COMPOSER_DEV_MODE -eq 0 ] || composer bin all install --ansi"
Expand Down
2 changes: 2 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function __construct(array $params = []) {
/**
* @psalm-suppress UndefinedClass
*/
#[\Override]
public function register(IRegistrationContext $context): void {
$context->registerService('ActivityDBConnection', function (ContainerInterface $c) {
$systemConfig = $c->get(SystemConfig::class);
Expand Down Expand Up @@ -134,6 +135,7 @@ public function register(IRegistrationContext $context): void {
$this->registerFilesActivity($context);
}

#[\Override]
public function boot(IBootContext $context): void {
$this->registerActivityConsumer();
$this->registerNotifier();
Expand Down
1 change: 1 addition & 0 deletions lib/BackgroundJob/DigestMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function __construct(
$this->setInterval(60 * 60);
}

#[\Override]
protected function run($argument) {
$this->digestSender->sendDigests($this->time->getTime());
}
Expand Down
1 change: 1 addition & 0 deletions lib/BackgroundJob/EmailNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function __construct(
$this->setInterval(1);
}

#[\Override]
protected function run($argument) {
// We don't use time() but "time() - 1" here, so we don't run into
// runtime issues later and delete emails, which were created in the
Expand Down
1 change: 1 addition & 0 deletions lib/BackgroundJob/ExpireActivities.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function __construct(ITimeFactory $time,
$this->config = $config;
}

#[\Override]
protected function run($argument): void {
// Remove activities that are older then one year
$expireDays = $this->config->getSystemValue('activity_expire_days', 365);
Expand Down
1 change: 1 addition & 0 deletions lib/BackgroundJob/RemoteActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function __construct(
parent::__construct($timeFactory);
}

#[\Override]
protected function run($argument) {
call_user_func_array([$this, 'sendActivity'], $argument);
}
Expand Down
1 change: 1 addition & 0 deletions lib/BackgroundJob/RemoveFormerActivitySettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function __construct(
$this->setInterval(24 * 60 * 60);
}

#[\Override]
protected function run($argument): void {
$preferencesToKeep = [
'notify_setting_activity_digest',
Expand Down
1 change: 1 addition & 0 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Capabilities implements ICapability {
/**
* Return this classes capabilities
*/
#[\Override]
public function getCapabilities() {
return [
'activity' => [
Expand Down
1 change: 1 addition & 0 deletions lib/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function __construct(
*
* @return void
*/
#[\Override]
public function receive(IEvent $event) {
$selfAction = $event->getAffectedUser() === $event->getAuthor();
$notificationSetting = $this->userSettings->getUserSetting($event->getAffectedUser(), 'notification', $event->getType());
Expand Down
11 changes: 11 additions & 0 deletions lib/Dashboard/ActivityWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,39 @@ public function __construct(IL10N $l10n,
/**
* @inheritDoc
*/
#[\Override]
public function getId(): string {
return Application::APP_ID;
}

/**
* @inheritDoc
*/
#[\Override]
public function getTitle(): string {
return $this->l10n->t('Recent activity');
}

/**
* @inheritDoc
*/
#[\Override]
public function getOrder(): int {
return 20;
}

/**
* @inheritDoc
*/
#[\Override]
public function getIconClass(): string {
return 'icon-activity';
}

/**
* @inheritDoc
*/
#[\Override]
public function getIconUrl(): string {
return $this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->imagePath(Application::APP_ID, 'activity-dark.svg')
Expand All @@ -86,6 +91,7 @@ public function getIconUrl(): string {
/**
* @inheritDoc
*/
#[\Override]
public function getUrl(): ?string {
return $this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkToRoute(Application::APP_ID . '.Activities.index')
Expand All @@ -95,13 +101,15 @@ public function getUrl(): ?string {
/**
* @inheritDoc
*/
#[\Override]
public function load(): void {
Util::addStyle('activity', 'style');
}

/**
* @inheritDoc
*/
#[\Override]
public function getItems(string $userId, ?string $since = null, int $limit = 7): array {
// we set the limit to 50 here because data->get might return less activity entries
// in the end we take the first 7 of'em
Expand Down Expand Up @@ -130,6 +138,7 @@ public function getItems(string $userId, ?string $since = null, int $limit = 7):
/**
* @inheritDoc
*/
#[\Override]
public function getItemsV2(string $userId, ?string $since = null, int $limit = 7): WidgetItems {
// we set the limit to 50 here because data->get might return less activity entries
// in the end we take the first 7 of'em
Expand Down Expand Up @@ -173,6 +182,7 @@ public function getItemsV2(string $userId, ?string $since = null, int $limit = 7
/**
* @inheritDoc
*/
#[\Override]
public function getWidgetButtons(string $userId): array {
return [
new WidgetButton(
Expand All @@ -188,6 +198,7 @@ public function getWidgetButtons(string $userId): array {
/**
* @inheritDoc
*/
#[\Override]
public function getReloadInterval(): int {
return 30;
}
Expand Down
6 changes: 6 additions & 0 deletions lib/Filter/AllFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function __construct(IL10N $l, IURLGenerator $url) {
* @return string Lowercase a-z only identifier
* @since 9.2.0
*/
#[\Override]
public function getIdentifier() {
return 'all';
}
Expand All @@ -39,6 +40,7 @@ public function getIdentifier() {
* @return string A translated string
* @since 9.2.0
*/
#[\Override]
public function getName() {
return $this->l->t('All activities');
}
Expand All @@ -47,6 +49,7 @@ public function getName() {
* @return int
* @since 9.2.0
*/
#[\Override]
public function getPriority() {
return 0;
}
Expand All @@ -55,6 +58,7 @@ public function getPriority() {
* @return string Full URL to an icon, empty string when none is given
* @since 9.2.0
*/
#[\Override]
public function getIcon() {
return $this->url->getAbsoluteURL($this->url->imagePath('activity', 'activity-dark.svg'));
}
Expand All @@ -64,6 +68,7 @@ public function getIcon() {
* @return string[] An array of allowed apps from which activities should be displayed
* @since 9.2.0
*/
#[\Override]
public function filterTypes(array $types) {
return $types;
}
Expand All @@ -72,6 +77,7 @@ public function filterTypes(array $types) {
* @return string[] An array of allowed apps from which activities should be displayed
* @since 9.2.0
*/
#[\Override]
public function allowedApps() {
return [];
}
Expand Down
6 changes: 6 additions & 0 deletions lib/Filter/ByFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function __construct(IL10N $l, IURLGenerator $url) {
* @return string Lowercase a-z only identifier
* @since 9.2.0
*/
#[\Override]
public function getIdentifier() {
return 'by';
}
Expand All @@ -39,6 +40,7 @@ public function getIdentifier() {
* @return string A translated string
* @since 9.2.0
*/
#[\Override]
public function getName() {
return $this->l->t('By others');
}
Expand All @@ -47,6 +49,7 @@ public function getName() {
* @return int
* @since 9.2.0
*/
#[\Override]
public function getPriority() {
return 2;
}
Expand All @@ -55,6 +58,7 @@ public function getPriority() {
* @return string Full URL to an icon, empty string when none is given
* @since 9.2.0
*/
#[\Override]
public function getIcon() {
return $this->url->getAbsoluteURL($this->url->imagePath('core', 'places/contacts.svg'));
}
Expand All @@ -64,6 +68,7 @@ public function getIcon() {
* @return string[] An array of allowed apps from which activities should be displayed
* @since 9.2.0
*/
#[\Override]
public function filterTypes(array $types) {
return $types;
}
Expand All @@ -72,6 +77,7 @@ public function filterTypes(array $types) {
* @return string[] An array of allowed apps from which activities should be displayed
* @since 9.2.0
*/
#[\Override]
public function allowedApps() {
return [];
}
Expand Down
6 changes: 6 additions & 0 deletions lib/Filter/SelfFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function __construct(IL10N $l, IURLGenerator $url) {
* @return string Lowercase a-z only identifier
* @since 9.2.0
*/
#[\Override]
public function getIdentifier() {
return 'self';
}
Expand All @@ -39,6 +40,7 @@ public function getIdentifier() {
* @return string A translated string
* @since 9.2.0
*/
#[\Override]
public function getName() {
return $this->l->t('By you');
}
Expand All @@ -47,6 +49,7 @@ public function getName() {
* @return int
* @since 9.2.0
*/
#[\Override]
public function getPriority() {
return 1;
}
Expand All @@ -55,6 +58,7 @@ public function getPriority() {
* @return string Full URL to an icon, empty string when none is given
* @since 9.2.0
*/
#[\Override]
public function getIcon() {
return $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/user.svg'));
}
Expand All @@ -64,6 +68,7 @@ public function getIcon() {
* @return string[] An array of allowed apps from which activities should be displayed
* @since 9.2.0
*/
#[\Override]
public function filterTypes(array $types) {
return $types;
}
Expand All @@ -72,6 +77,7 @@ public function filterTypes(array $types) {
* @return string[] An array of allowed apps from which activities should be displayed
* @since 9.2.0
*/
#[\Override]
public function allowedApps() {
return [];
}
Expand Down
1 change: 1 addition & 0 deletions lib/Listener/LoadSidebarScripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @template-implements IEventListener<Event>
*/
class LoadSidebarScripts implements IEventListener {
#[\Override]
public function handle(Event $event): void {
if (!($event instanceof LoadSidebar)) {
return;
Expand Down
1 change: 1 addition & 0 deletions lib/Listener/SetUserDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function __construct(IConfig $config) {
$this->config = $config;
}

#[\Override]
public function handle(Event $event): void {
if (!($event instanceof PostLoginEvent)) {
return;
Expand Down
1 change: 1 addition & 0 deletions lib/Listener/ShareEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function __construct(
) {
}

#[\Override]
public function handle(Event $event): void {
if ($event instanceof BeforeShareDeletedEvent) {
$this->unShare($event);
Expand Down
1 change: 1 addition & 0 deletions lib/Listener/UserDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function __construct(Data $data, MailQueueHandler $mailQueueHandler) {
$this->mailQueueHandler = $mailQueueHandler;
}

#[\Override]
public function handle(Event $event): void {
if (!($event instanceof UserDeletedEvent)) {
return;
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2006Date20170808154933.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Version2006Date20170808154933 extends SimpleMigrationStep {
* @return null|ISchemaWrapper
* @since 13.0.0
*/
#[\Override]
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2006Date20170808155040.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Version2006Date20170808155040 extends SimpleMigrationStep {
* @throws \Doctrine\DBAL\Schema\SchemaException
* @since 13.0.0
*/
#[\Override]
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
/**
Expand Down
2 changes: 2 additions & 0 deletions lib/Migration/Version2006Date20170919095939.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Version2006Date20170919095939 extends BigIntMigration {
* ['table1' => ['column1', 'column2'], ...]
* @since 13.0.0
*/
#[\Override]
protected function getColumnsByTable() {
return [
'activity' => ['activity_id', 'object_id'],
Expand All @@ -31,6 +32,7 @@ protected function getColumnsByTable() {
* @return null|ISchemaWrapper
* @since 13.0.0
*/
#[\Override]
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
/**
* FIXME To prevent slowness on update we don't change the schema.
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2007Date20181107114613.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Version2007Date20181107114613 extends SimpleMigrationStep {
* @param array $options
* @return null|ISchemaWrapper
*/
#[\Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2008Date20181011095117.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Version2008Date20181011095117 extends SimpleMigrationStep {
* @param array $options
* @return null|ISchemaWrapper
*/
#[\Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
Loading
Loading