Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump max-version of PHP to 8.3 #1194

Merged
merged 1 commit into from
Dec 28, 2023
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
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
Loading