diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 229fb49..8d74b98 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -28,6 +28,30 @@ jobs:
- name: Lint
run: composer run lint
+ php-cs-fixer:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ php-versions: ['7.4']
+
+ name: cs php${{ matrix.php-versions }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+
+ - name: Set up php
+ uses: shivammathur/setup-php@master
+ with:
+ php-version: ${{ matrix.php-versions }}
+ coverage: none
+
+ - name: Install dependencies
+ run: composer i
+
+ - name: Run coding standards check
+ run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
+
node:
runs-on: ubuntu-latest
@@ -35,7 +59,7 @@ jobs:
matrix:
node-versions: [12.x]
- name: node${{ matrix.node-versions }}
+ name: eslint node${{ matrix.node-versions }}
steps:
- uses: actions/checkout@v2
@@ -49,3 +73,25 @@ jobs:
- name: Lint
run: npm run lint
+
+ stylelint:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-versions: [12.x]
+
+ name: stylelint node${{ matrix.node-versions }}
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up node ${{ matrix.node-versions }}
+ uses: actions/setup-node@v1
+ with:
+ node-versions: ${{ matrix.node-versions }}
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Lint
+ run: npm run stylelint
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 2185767..739a1d9 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -8,17 +8,19 @@
2.0.0-beta1
agpl
- Vinzenz Rosenkranz
- René Gieling
- Kai Schröer
- Natalie Gilbert
- Nick Gallo
- Inigo Jiron
Affan Hussain
Ajfar Huq
- Tim Sattizahn
- Stephan Link
+ Inigo Jiron
+ John Molakvoæ
+ Jonas Rittershofer
+ Kai Schröer
Kameron Sheppard
+ Natalie Gilbert
+ Nick Gallo
+ René Gieling
+ Stephan Link
+ Tim Sattizahn
+ Vinzenz Rosenkranz
tools
social
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 23817ae..f188b0d 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -2,22 +2,25 @@
/**
* @copyright Copyright (c] 2017 Vinzenz Rosenkranz
*
- * @author Vinzenz Rosenkranz
+ * @author affan98
+ * @author John Molakvoæ (skjnldsv)
+ * @author Jonas Rittershofer
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option] any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/composer.json b/composer.json
index 7138561..8300f0e 100644
--- a/composer.json
+++ b/composer.json
@@ -2,22 +2,18 @@
"name": "nextcloud/forms",
"type": "project",
"license": "AGPLv3",
- "authors": [
- {
- "name": "Vinzenz Rosenkranz"
- },
- {
- "name": "Kai Schröer"
- },
- {
- "name": "René Gieling"
- }
- ],
"require-dev": {
- "christophwurst/nextcloud": "^16.0",
- "phpunit/phpunit": "^8"
- },
- "scripts": {
- "lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;"
- }
+ "christophwurst/nextcloud": "^17.0",
+ "phpunit/phpunit": "^8",
+ "nextcloud/coding-standard": "^0.3.0"
+ },
+ "config": {
+ "optimize-autoloader": true,
+ "classmap-authoritative": true
+ },
+ "scripts": {
+ "lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;",
+ "cs:check": "php-cs-fixer fix --dry-run --diff",
+ "cs:fix": "php-cs-fixer fix"
+ }
}
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index dddd5f8..d7c02af 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -1,24 +1,27 @@
*
- * @author Vinzenz Rosenkranz
+ * @author affan98
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php
index 9394c04..6481d5c 100644
--- a/lib/Controller/ApiController.php
+++ b/lib/Controller/ApiController.php
@@ -1,29 +1,26 @@
*
- * @author René Gieling
- * @author Natalie Gilbert
- * @author Inigo Jiron
- * @author Affan Hussain
+ * @author affan98
+ * @author John Molakvoæ (skjnldsv)
* @author Jonas Rittershofer
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
index 2c8ce9c..92f3ead 100644
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -2,28 +2,26 @@
/**
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz
*
- * @author Vinzenz Rosenkranz
- * @author René Gieling
- * @author Inigo Jiron
- * @author Natalie Gilbert
- * @author Affan Hussain
- * @author John Molakvoæ
+ * @author affan98
+ * @author John Molakvoæ (skjnldsv)
* @author Jonas Rittershofer
+ * @author Marcel Klehr
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Controller/SystemController.php b/lib/Controller/SystemController.php
index c3d716e..68a517d 100644
--- a/lib/Controller/SystemController.php
+++ b/lib/Controller/SystemController.php
@@ -2,22 +2,23 @@
/**
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz
*
- * @author René Gieling
+ * @author affan98
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/Answer.php b/lib/Db/Answer.php
index 4b5f3b1..250697e 100644
--- a/lib/Db/Answer.php
+++ b/lib/Db/Answer.php
@@ -1,25 +1,28 @@
*
+ * @author affan98
* @author Jonas Rittershofer
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/AnswerMapper.php b/lib/Db/AnswerMapper.php
index 9330890..58c18b1 100644
--- a/lib/Db/AnswerMapper.php
+++ b/lib/Db/AnswerMapper.php
@@ -2,22 +2,24 @@
/**
* @copyright Copyright (c) 2020 Jonas Rittershofer
*
+ * @author affan98
+ * @author John Molakvoæ (skjnldsv)
* @author Jonas Rittershofer
-*
+ *
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/Form.php b/lib/Db/Form.php
index 9941bee..81940f9 100644
--- a/lib/Db/Form.php
+++ b/lib/Db/Form.php
@@ -1,26 +1,27 @@
*
- * @author Vinzenz Rosenkranz
- * @author Kai Schröer
- * @author René Gieling
-*
+ * @author affan98
+ * @author Jonas Rittershofer
+ *
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/FormMapper.php b/lib/Db/FormMapper.php
index 72e1e03..f8e7812 100644
--- a/lib/Db/FormMapper.php
+++ b/lib/Db/FormMapper.php
@@ -2,23 +2,24 @@
/**
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz
*
- * @author Vinzenz Rosenkranz
- * @author René Gieling
+ * @author affan98
+ * @author Jonas Rittershofer
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/Option.php b/lib/Db/Option.php
index 69f6065..01b3204 100644
--- a/lib/Db/Option.php
+++ b/lib/Db/Option.php
@@ -1,25 +1,26 @@
*
- * @author Inigo Jiron
+ * @author Jonas Rittershofer
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/OptionMapper.php b/lib/Db/OptionMapper.php
index 218314b..6e25fa1 100644
--- a/lib/Db/OptionMapper.php
+++ b/lib/Db/OptionMapper.php
@@ -1,26 +1,26 @@
*
- * @author Inigo Jiron
- * @author Natalie Gilbert
+ * @author Jonas Rittershofer
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/Question.php b/lib/Db/Question.php
index 25f5199..77860ce 100644
--- a/lib/Db/Question.php
+++ b/lib/Db/Question.php
@@ -1,24 +1,29 @@
*
- * @author Inigo Jiron
+ * @author affan98
+ * @author John Molakvoæ (skjnldsv)
+ * @author Jonas Rittershofer
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/QuestionMapper.php b/lib/Db/QuestionMapper.php
index a953c7e..83df607 100644
--- a/lib/Db/QuestionMapper.php
+++ b/lib/Db/QuestionMapper.php
@@ -2,23 +2,25 @@
/**
* @copyright Copyright (c) 2019 Inigo Jiron
*
- * @author Inigo Jiron
- * @author Natalie Gilbert
+ * @author affan98
+ * @author John Molakvoæ (skjnldsv)
+ * @author Jonas Rittershofer
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/Submission.php b/lib/Db/Submission.php
index 58b35f6..8c639ac 100644
--- a/lib/Db/Submission.php
+++ b/lib/Db/Submission.php
@@ -1,25 +1,28 @@
*
+ * @author affan98
* @author Jonas Rittershofer
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Db/SubmissionMapper.php b/lib/Db/SubmissionMapper.php
index 0e65522..32a968a 100644
--- a/lib/Db/SubmissionMapper.php
+++ b/lib/Db/SubmissionMapper.php
@@ -2,22 +2,24 @@
/**
* @copyright Copyright (c) 2020 Jonas Rittershofer
*
+ * @author affan98
* @author Jonas Rittershofer
+ * @author Roeland Jago Douma
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Migration/Version0010Date20190000000007.php b/lib/Migration/Version0010Date20190000000007.php
index 14f260c..f30dd84 100644
--- a/lib/Migration/Version0010Date20190000000007.php
+++ b/lib/Migration/Version0010Date20190000000007.php
@@ -6,18 +6,18 @@
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Migration/Version010102Date20200323120846.php b/lib/Migration/Version010102Date20200323120846.php
index 8ed98b2..3c1a9a3 100644
--- a/lib/Migration/Version010102Date20200323120846.php
+++ b/lib/Migration/Version010102Date20200323120846.php
@@ -2,6 +2,29 @@
declare(strict_types=1);
+/**
+ *
+ *
+ * @author John Molakvoæ (skjnldsv)
+ * @author Jonas Rittershofer
+ * @author Roeland Jago Douma
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ *
+ */
namespace OCA\Forms\Migration;
use Closure;
diff --git a/lib/Migration/Version010200Date20200323141300.php b/lib/Migration/Version010200Date20200323141300.php
index e236b02..cb63716 100644
--- a/lib/Migration/Version010200Date20200323141300.php
+++ b/lib/Migration/Version010200Date20200323141300.php
@@ -2,22 +2,23 @@
/**
* @copyright Copyright (c) 2020 Jonas Rittershofer
*
+ * @author John Molakvoæ (skjnldsv)
* @author Jonas Rittershofer
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/lib/Service/FormsService.php b/lib/Service/FormsService.php
index 7d78bc8..c6e0c38 100644
--- a/lib/Service/FormsService.php
+++ b/lib/Service/FormsService.php
@@ -2,21 +2,22 @@
/**
* @copyright Copyright (c) 2020 John Molakvoæ
*
- * @author John Molakvoæ
+ * @author John Molakvoæ (skjnldsv)
*
* @license GNU AGPL version 3 or any later version
*
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/license.php b/license.php
new file mode 100644
index 0000000..40d9805
--- /dev/null
+++ b/license.php
@@ -0,0 +1,390 @@
+
+ *
+ */
+class Licenses {
+ protected $paths = [];
+ protected $mailMap = [];
+ protected $checkFiles = [];
+ public $authors = [];
+
+ public function __construct() {
+ $this->licenseText = <<.
+ *
+ */
+EOD;
+ $this->licenseTextLegacy = <<
+ *
+ */
+EOD;
+ $this->licenseTextLegacy = str_replace('@YEAR@', date("Y"), $this->licenseTextLegacy);
+ }
+
+ /**
+ * @param string|string[] $folder
+ * @param string|bool $gitRoot
+ */
+ public function exec($folder, $gitRoot = false) {
+ if (is_array($folder)) {
+ foreach ($folder as $f) {
+ $this->exec($f, $gitRoot);
+ }
+ return;
+ }
+
+ if ($gitRoot !== false && substr($gitRoot, -1) !== '/') {
+ $gitRoot .= '/';
+ }
+
+ if (is_file($folder)) {
+ $this->handleFile($folder, $gitRoot);
+ $this->printFilesToCheck();
+ return;
+ }
+
+ $excludes = array_map(function ($item) use ($folder) {
+ return $folder . '/' . $item;
+ }, ['vendor', '3rdparty', '.git', 'l10n', 'templates', 'composer']);
+
+ $iterator = new RecursiveDirectoryIterator($folder, RecursiveDirectoryIterator::SKIP_DOTS);
+ $iterator = new RecursiveCallbackFilterIterator($iterator, function ($item) use ($folder, $excludes) {
+ /** @var SplFileInfo $item */
+ foreach ($excludes as $exclude) {
+ if (substr($item->getPath(), 0, strlen($exclude)) === $exclude) {
+ return false;
+ }
+ }
+ return true;
+ });
+ $iterator = new RecursiveIteratorIterator($iterator);
+ $iterator = new RegexIterator($iterator, '/^.+\.php$/i');
+
+ foreach ($iterator as $file) {
+ /** @var SplFileInfo $file */
+ $this->handleFile($file, $gitRoot);
+ }
+
+ $this->printFilesToCheck();
+ }
+
+ public function writeAuthorsFile() {
+ ksort($this->authors);
+ $template = "Nextcloud is written by:
+@AUTHORS@
+
+With help from many libraries and frameworks including:
+ Open Collaboration Services
+ SabreDAV
+ jQuery
+ …
+";
+ $authors = implode(PHP_EOL, array_map(function ($author) {
+ return " - ".$author;
+ }, $this->authors));
+ $template = str_replace('@AUTHORS@', $authors, $template);
+ file_put_contents(__DIR__.'/../AUTHORS', $template);
+ }
+
+ public function handleFile($path, $gitRoot) {
+ $source = file_get_contents($path);
+ if ($this->isMITLicensed($source)) {
+ echo "MIT licensed file: $path" . PHP_EOL;
+ return;
+ }
+ $copyrightNotices = $this->getCopyrightNotices($path, $source);
+ $authors = $this->getAuthors($path, $gitRoot);
+ if ($this->isOwnCloudLicensed($source)) {
+ $license = str_replace('@AUTHORS@', $authors, $this->licenseTextLegacy);
+ $this->checkCopyrightState($path, $gitRoot);
+ } else {
+ $license = str_replace('@AUTHORS@', $authors, $this->licenseText);
+ }
+
+ if ($copyrightNotices === '') {
+ $license = str_replace('@COPYRIGHT@', ' *', $license);
+ } else {
+ $license = str_replace('@COPYRIGHT@', $copyrightNotices, $license);
+ }
+
+ [$source, $isStrict] = $this->eatOldLicense($source);
+ if ($isStrict) {
+ $source = "getTimestamp();
+
+ $buildDir = getcwd();
+ if ($gitRoot) {
+ chdir($gitRoot);
+ $path = substr($path, strlen($gitRoot));
+ }
+ $out = shell_exec("git --no-pager blame --line-porcelain $path | sed -n 's/^author-time //p'");
+ if ($gitRoot) {
+ chdir($buildDir);
+ }
+ $timestampChanges = explode(PHP_EOL, $out);
+ $timestampChanges = array_slice($timestampChanges, 0, count($timestampChanges)-1);
+ foreach ($timestampChanges as $timestamp) {
+ if ((int)$timestamp < $deadlineTimestamp) {
+ return;
+ }
+ }
+
+ //all changes after the deadline
+ $this->checkFiles[] = $path;
+ }
+
+ private function printFilesToCheck() {
+ if (!empty($this->checkFiles)) {
+ print "\n";
+ print "For following files all lines changed since the Nextcloud fork." . PHP_EOL;
+ print "Please check if these files can be moved over to AGPLv3 or later" . PHP_EOL;
+ print "\n";
+ foreach ($this->checkFiles as $file) {
+ print $file . PHP_EOL;
+ }
+ print "\n";
+ }
+ }
+
+ private function getAuthors($file, $gitRoot) {
+ // only add authors that changed code and not the license header
+ $licenseHeaderEndsAtLine = trim(shell_exec("grep -n '*/' $file | head -n 1 | cut -d ':' -f 1"));
+ $buildDir = getcwd();
+ if ($gitRoot) {
+ chdir($gitRoot);
+ $file = substr($file, strlen($gitRoot));
+ }
+ $out = shell_exec("git blame --line-porcelain -L $licenseHeaderEndsAtLine, $file | sed -n 's/^author //p;s/^author-mail //p' | sed 'N;s/\\n/ /' | sort -f | uniq");
+ if ($gitRoot) {
+ chdir($buildDir);
+ }
+ $authors = explode(PHP_EOL, $out);
+
+ $authors = array_filter($authors, function ($author) {
+ return !in_array($author, [
+ '',
+ 'Not Committed Yet ',
+ 'Jenkins for ownCloud ',
+ 'Scrutinizer Auto-Fixer ',
+ ]);
+ });
+
+ if ($gitRoot) {
+ $authors = array_map([$this, 'checkCoreMailMap'], $authors);
+ $authors = array_unique($authors);
+ }
+
+ $authors = array_map(function ($author) {
+ $author = $this->fixInvalidEmail($author);
+ $this->authors[$author] = $author;
+ return " * @author $author";
+ }, $authors);
+
+ return implode(PHP_EOL, $authors);
+ }
+
+ private function checkCoreMailMap($author) {
+ if (empty($this->mailMap)) {
+ $content = file_get_contents(__DIR__ . '/../.mailmap');
+ $entries = explode("\n", $content);
+ foreach ($entries as $entry) {
+ if (strpos($entry, '> ') === false) {
+ $this->mailMap[$entry] = $entry;
+ } else {
+ list($use, $actual) = explode('> ', $entry);
+ $this->mailMap[$actual] = $use . '>';
+ }
+ }
+ }
+
+ if (isset($this->mailMap[$author])) {
+ return $this->mailMap[$author];
+ }
+ return $author;
+ }
+
+ private function fixInvalidEmail($author) {
+ preg_match('/<(.*)>/', $author, $mailMatch);
+ if (count($mailMatch) === 2 && !filter_var($mailMatch[1], FILTER_VALIDATE_EMAIL)) {
+ $author = str_replace('<'.$mailMatch[1].'>', '"'.$mailMatch[1].'"', $author);
+ }
+ return $author;
+ }
+}
+
+$licenses = new Licenses;
+if (isset($argv[1])) {
+ $licenses->exec($argv[1], isset($argv[2]) ? $argv[1] : false);
+} else {
+ $licenses->exec([
+ './appinfo',
+ './lib',
+ './templates'
+ ]);
+ $licenses->writeAuthorsFile();
+}
diff --git a/package.json b/package.json
index c0d17ac..ca55d7c 100644
--- a/package.json
+++ b/package.json
@@ -2,50 +2,6 @@
"name": "forms",
"description": "Forms app for nextcloud",
"version": "2.0.0-beta1",
- "authors": [
- {
- "name": "Vinzenz Rosenkranz",
- "email": "vinzenz.rosenkranz@gmail.com",
- "role": "Polls App Developer"
- },
- {
- "name": "Rene Gieling",
- "email": "github@dartcafe.de",
- "role": "Polls App Developer"
- },
- {
- "name": "Natalie Gilbert",
- "role": "Forms Team Lead/Back End Developer"
- },
- {
- "name": "Inigo Jiron",
- "role": "Back End Developer/Database Specialist"
- },
- {
- "name": "Affan Hussain",
- "role": "Forms Technical Lead"
- },
- {
- "name": "Nick Gallo",
- "role": "Front End Developer"
- },
- {
- "name": "Ajfar Huq",
- "role": "Front End Developer"
- },
- {
- "name": "Tim Sattizahn",
- "role": "Forms QA Lead"
- },
- {
- "name": "Stephan Link",
- "role": "Quality Assurance"
- },
- {
- "name": "Kameron Sheppard",
- "role": "Quality Assurance"
- }
- ],
"repository": {
"type": "git",
"url": "git+https://github.com/nextcloud/forms.git"
diff --git a/templates/expired.php b/templates/expired.php
index 0b47977..683349f 100644
--- a/templates/expired.php
+++ b/templates/expired.php
@@ -1,25 +1,23 @@
*
- * @author Inigo Jiron
- * @author John Molakvoæ
+ * @author John Molakvoæ (skjnldsv)
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/templates/main.php b/templates/main.php
index b4d8170..5e3042b 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -2,7 +2,7 @@
/**
* @copyright Copyright (c) 2020 John Molakvoæ
*
- * @author John Molakvoæ
+ * @author John Molakvoæ (skjnldsv)
*
* @license GNU AGPL version 3 or any later version
*
@@ -13,7 +13,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
diff --git a/templates/notfound.php b/templates/notfound.php
index c2bb0cd..91b53ee 100644
--- a/templates/notfound.php
+++ b/templates/notfound.php
@@ -1,25 +1,23 @@
*
- * @author Inigo Jiron
- * @author John Molakvoæ
+ * @author John Molakvoæ (skjnldsv)
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index c0a5452..af159a5 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -2,22 +2,22 @@
/**
* @copyright Copyright (c) 2017 Kai Schröer
*
- * @author Kai Schröer
+ * @author affan98
*
* @license GNU AGPL version 3 or any later version
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
*
*/