Skip to content

Commit d87a5c3

Browse files
committed
fix: EUPL licence tag, SPDX headers, getRequestToken, readonly constructors
Issues caught by every code review on apps built from this template: - <licence>agpl</licence> → <licence>eupl</licence> - OC.requestToken → getRequestToken() from @nextcloud/auth - Added SPDX-License-Identifier: EUPL-1.2 to all PHP/JS/Vue files - Constructor properties: private → private readonly
1 parent 02315e7 commit d87a5c3

21 files changed

Lines changed: 29 additions & 6 deletions

File tree

appinfo/routes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
// SPDX-License-Identifier: EUPL-1.2
23

34
declare(strict_types=1);
45

lib/AppInfo/Application.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
// SPDX-License-Identifier: EUPL-1.2
23

34
/**
45
* AppTemplate Application

lib/Controller/DashboardController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
// SPDX-License-Identifier: EUPL-1.2
23

34
/**
45
* AppTemplate Dashboard Controller

lib/Sections/SettingsSection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
// SPDX-License-Identifier: EUPL-1.2
23

34
/**
45
* AppTemplate Settings Section
@@ -39,8 +40,8 @@ class SettingsSection implements IIconSection
3940
* @return void
4041
*/
4142
public function __construct(
42-
private IL10N $l,
43-
private IURLGenerator $urlGenerator,
43+
private readonly IL10N $l,
44+
private readonly IURLGenerator $urlGenerator,
4445
) {
4546
}//end __construct()
4647

lib/Settings/AdminSettings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
// SPDX-License-Identifier: EUPL-1.2
23

34
/**
45
* AppTemplate Admin Settings
@@ -37,7 +38,7 @@ class AdminSettings implements ISettings
3738
* @param IAppManager $appManager The app manager.
3839
*/
3940
public function __construct(
40-
private IAppManager $appManager,
41+
private readonly IAppManager $appManager,
4142
) {
4243
}//end __construct()
4344

phpcs-custom-sniffs/CustomSniffs/Sniffs/Functions/NamedParametersSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
// SPDX-License-Identifier: EUPL-1.2
23
/**
34
* Enforce named parameters for all calls to internal (our own) code.
45
*

phpstan-bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
// SPDX-License-Identifier: EUPL-1.2
23

34
/**
45
* PHPStan bootstrap file - registers OCP autoloader for static analysis.

src/App.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- SPDX-License-Identifier: EUPL-1.2 -->
12
<template>
23
<NcContent app-name="app-template">
34
<template v-if="storesReady && !hasOpenRegisters">

src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: EUPL-1.2
12
import Vue from 'vue'
23
import { PiniaVuePlugin } from 'pinia'
34
import { translate as t, translatePlural as n, loadTranslations } from '@nextcloud/l10n'

src/pinia.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: EUPL-1.2
12
import { createPinia } from 'pinia'
23

34
const pinia = createPinia()

0 commit comments

Comments
 (0)