Skip to content

Commit

Permalink
Merge pull request #1194 from nextcloud/chore/bump-php-8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Dec 28, 2023
2 parents c0b4852 + 5ec7be8 commit 77fd11f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The Notes app is a distraction free notes taking app for [Nextcloud](https://www
<repository type="git">https://github.com/nextcloud/notes.git</repository>
<screenshot small-thumbnail="https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Notes/notes-thumbnail.jpg">https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Notes/notes.png</screenshot>
<dependencies>
<php min-version="7.4" max-version="8.2"/>
<php min-version="7.4" max-version="8.3"/>
<nextcloud min-version="25" max-version="29"/>
</dependencies>
<repair-steps>
Expand Down
2 changes: 2 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OCP\EventDispatcher\GenericEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Share\Events\BeforeShareCreatedEvent;
/** @phan-suppress-next-line PhanUnreferencedUseNormal */
use OCP\Share\IShare;

class Application extends App implements IBootstrap {
Expand Down Expand Up @@ -43,6 +44,7 @@ public function register(IRegistrationContext $context): void {
}

/** @var IShare $share */
/** @phan-suppress-next-line PhanDeprecatedFunction */
$share = $event->getSubject();

$modernListener = \OCP\Server::get(BeforeShareCreatedListener::class);
Expand Down
1 change: 1 addition & 0 deletions lib/AppInfo/BeforeShareCreatedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
class BeforeShareCreatedListener implements IEventListener {
private SettingsService $settings;
private NoteUtil $noteUtil;
private LoggerInterface $logger;

public function __construct(SettingsService $settings, NoteUtil $noteUtil, LoggerInterface $logger) {
$this->settings = $settings;
Expand Down
12 changes: 10 additions & 2 deletions lib/AppInfo/DashboardWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,18 @@ public function load(): void {

public function getWidgetButtons(string $userId): array {
$buttons = [
new WidgetButton(WidgetButton::TYPE_NEW, $this->url->linkToRouteAbsolute('notes.page.create'), $this->l10n->t('Create new note'))
new WidgetButton(
WidgetButton::TYPE_NEW,
$this->url->linkToRouteAbsolute('notes.page.create'),
$this->l10n->t('Create new note')
)
];
if ($this->notesService->countNotes($userId) > 7) {
$buttons[] = new WidgetButton(WidgetButton::TYPE_MORE, $this->url->linkToRouteAbsolute('notes.page.index'), $this->l10n->t('More notes'));
$buttons[] = new WidgetButton(
WidgetButton::TYPE_MORE,
$this->url->linkToRouteAbsolute('notes.page.index'),
$this->l10n->t('More notes')
);
}
return $buttons;
}
Expand Down
10 changes: 8 additions & 2 deletions lib/Controller/NotesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,14 @@ public function getAttachment(int $noteid, string $path): Http\Response {
$path
);
$response = new StreamResponse($targetimage->fopen('rb'));
$response->addHeader('Content-Disposition', 'attachment; filename="' . rawurldecode($targetimage->getName()) . '"');
$response->addHeader('Content-Type', $this->mimeTypeDetector->getSecureMimeType($targetimage->getMimeType()));
$response->addHeader(
'Content-Disposition',
'attachment; filename="' . rawurldecode($targetimage->getName()) . '"'
);
$response->addHeader(
'Content-Type',
$this->mimeTypeDetector->getSecureMimeType($targetimage->getMimeType())
);
$response->addHeader('Cache-Control', 'public, max-age=604800');
return $response;
} catch (\Exception $e) {
Expand Down
15 changes: 10 additions & 5 deletions tests/phan-config.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<?php

$testDirs = [
'lib/',
'vendor/',
];

if (getenv('NC_API_TAG') === 'dev-stable25') {
$testDirs[] = 'tests/stubs/';
}

return [
'directory_list' => [
'lib/',
'vendor/',
'tests/stubs/',
],
'directory_list' => $testDirs,
"exclude_analysis_directory_list" => [
'vendor/',
],
Expand Down

0 comments on commit 77fd11f

Please sign in to comment.