From 19025406ced60c320cf7ab337e5199443a4689d9 Mon Sep 17 00:00:00 2001 From: Jane Adelmann Date: Thu, 1 Nov 2018 18:50:10 +0200 Subject: [PATCH] Fix linter issues. Prepare version 1.19 --- .gitignore | 2 ++ .travis.yml | 50 ++++++++++++++++++++++++++++++++++ amd/build/main.min.js | 1 - component/ApiProvider.php | 1 + component/UrlGenerator.php | 1 + db/access.php | 1 + db/events.php | 1 + db/install.php | 1 + form/plagiarism_form.php | 3 +- form/send_text_form.php | 8 +++--- lang/en/plagiarism_pchkorg.php | 1 + lib.php | 1 + model/ConfigModel.php | 1 + model/FileModel.php | 1 + page/check.php | 1 + page/report.php | 5 ++-- settings.php | 1 + version.php | 5 ++-- view/check_report.php | 6 +++- view/report.php | 47 ++++++++++++++++---------------- view/send_text.php | 6 +++- 21 files changed, 109 insertions(+), 35 deletions(-) create mode 100644 .gitignore create mode 100644 .travis.yml delete mode 100644 amd/build/main.min.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6ef218 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..10ca726 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,50 @@ +language: php + +sudo: true + +addons: + firefox: "47.0.1" + postgresql: "9.4" + apt: + packages: + - oracle-java8-installer + - oracle-java8-set-default + +cache: + directories: + - $HOME/.composer/cache + - $HOME/.npm + +php: +- 7.0 +- 7.1 + +env: + global: + - MOODLE_BRANCH=MOODLE_35_STABLE + matrix: + - DB=pgsql + - DB=mysqli + +before_install: +- phpenv config-rm xdebug.ini +- nvm install 8.9 +- nvm use 8.9 +- cd ../.. +- composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci ^2 +- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH" + +install: +- moodle-plugin-ci install + +script: +- moodle-plugin-ci phplint +- moodle-plugin-ci phpcpd +- moodle-plugin-ci phpmd +#- moodle-plugin-ci codechecker +- moodle-plugin-ci validate +- moodle-plugin-ci savepoints +- moodle-plugin-ci mustache +#- moodle-plugin-ci grunt +- moodle-plugin-ci phpunit +- moodle-plugin-ci behat \ No newline at end of file diff --git a/amd/build/main.min.js b/amd/build/main.min.js deleted file mode 100644 index 3dc7c1d..0000000 --- a/amd/build/main.min.js +++ /dev/null @@ -1 +0,0 @@ -define(["jquery"],function(a){return{checkReport:function(){window.console.log("loaded",a)}}}); \ No newline at end of file diff --git a/component/ApiProvider.php b/component/ApiProvider.php index 93416ad..9e8821f 100644 --- a/component/ApiProvider.php +++ b/component/ApiProvider.php @@ -1,5 +1,6 @@ libdir/formslib.php"); class send_text_form extends moodleform { - //Add elements to form + // Add elements to form public function definition() { global $CFG; @@ -21,9 +21,9 @@ class send_text_form extends moodleform } - //Custom validation should be added here + // Custom validation should be added here function validation($data, $files) { return array(); } -} \ No newline at end of file +} diff --git a/lang/en/plagiarism_pchkorg.php b/lang/en/plagiarism_pchkorg.php index 90d76a5..975b5ca 100644 --- a/lang/en/plagiarism_pchkorg.php +++ b/lang/en/plagiarism_pchkorg.php @@ -1,4 +1,5 @@ get_file_by_id($fileid); if (!$file) { - //file not found + // file not found die('404 not exists'); } @@ -74,7 +75,7 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) {// form submission $file = $fs->get_file_by_id($fileid); if (!$file) { - //file not found + // file not found die('404 not exists'); } diff --git a/settings.php b/settings.php index 4dfd95f..2a3111b 100644 --- a/settings.php +++ b/settings.php @@ -1,4 +1,5 @@ version = 2018103102; +$plugin->version = 2018110101; $plugin->requires = 2017051501; // Requires Moodle 3.3 . -$plugin->release = 'v1.18'; +$plugin->release = 'v1.19'; $plugin->maturity = MATURITY_STABLE; $plugin->component = 'plagiarism_pchkorg'; diff --git a/view/check_report.php b/view/check_report.php index 5bbb30b..b971d28 100644 --- a/view/check_report.php +++ b/view/check_report.php @@ -1,5 +1,6 @@ header(); ?>
-
+
footer(); \ No newline at end of file diff --git a/view/report.php b/view/report.php index 4289898..f7fbc39 100644 --- a/view/report.php +++ b/view/report.php @@ -1,4 +1,5 @@ requires->css('/plagiarism/pchkorg/assets/viewer/report-viewer.min.css'); echo $OUTPUT->header(); @@ -6,32 +7,32 @@ echo $OUTPUT->header(); ?>
- - - - -

Error:

+if (empty($error)) { + ?> + + + +

Error:

+ footer(); \ No newline at end of file +} + +echo $OUTPUT->footer(); diff --git a/view/send_text.php b/view/send_text.php index 9e096a9..a444a9e 100644 --- a/view/send_text.php +++ b/view/send_text.php @@ -1,5 +1,6 @@ header(); ?> @@ -17,13 +18,15 @@ echo $OUTPUT->header();
- +

display(); } else { @@ -32,4 +35,5 @@ echo $OUTPUT->header(); ?>
footer(); \ No newline at end of file