Commit 13ccc6d8 authored by Luke081515's avatar Luke081515

Fix phpcs error

* Fixed errors pointed out by phpcs
parent 4cef6f2c
Pipeline #1202 passed with stages
in 1 minute
#!/usr/bin/php #!/usr/bin/php
<?php <?php
include './Core/BotCore.php'; require './Core/BotCore.php';
/** AnserWikiBrowser.php /** AnserWikiBrowser.php
* Opens a page in a user-defined editor and let’s you do things. * Opens a page in a user-defined editor and let’s you do things.
* @Author KPFC * @Author KPFC
* @Version 0.1 * @Version 0.1
* @Status Alpha * @Status Alpha
*/ */
class AnserWikiBrowser extends Core { class AnserWikiBrowser extends Core {
public function AnserWikiBrowser ($Account, $Job, $pUseHTTPS = true) { public function __construct ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS = true); //login $this->initcurl($Account, $Job, $pUseHTTPS); //login
//ask for editor to use //ask for editor to use
$editor = $this->askOperator('Enter your favorit text editor:'); $editor = $this->askOperator('Enter your favorit text editor:');
if (!$editor) { if (!$editor) {
...@@ -84,5 +84,5 @@ class AnserWikiBrowser extends Core { ...@@ -84,5 +84,5 @@ class AnserWikiBrowser extends Core {
unlink($page_tmp); unlink($page_tmp);
} }
} }
$Bot = new AnserWikiBrowser ('KPFC@test2wiki', 'Custom-Edit'); // Aufrufen der definierten Passwortdaten in Password.php $Bot = new AnserWikiBrowser('KPFC@test2wiki', 'Custom-Edit'); // Aufrufen der definierten Passwortdaten in Password.php
?> ?>
#!/usr/bin/php #!/usr/bin/php
<?php <?php
include './Core/BotCore.php'; require './Core/BotCore.php';
/** EditInEditor.php /** EditInEditor.php
* Opens a page in a user-defined editor and saves the page after closing the editor * Opens a page in a user-defined editor and saves the page after closing the editor
* @Author KPFC * @Author KPFC
* @Version 0.1 * @Version 0.1
* @Status Alpha * @Status Alpha
*/ */
class EditInEditor extends Core { class EditInEditor extends Core {
public function EditInEditor ($Account, $Job, $pUseHTTPS = true) { public function __construct ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS = true); //login $this->initcurl($Account, $Job, $pUseHTTPS); //login
//ask for editor to use //ask for editor to use
// $editor = $this->askOperator('Enter your favorit text editor:'); // $editor = $this->askOperator('Enter your favorit text editor:');
// if (!$editor) { // if (!$editor) {
...@@ -28,9 +28,9 @@ class EditInEditor extends Core { ...@@ -28,9 +28,9 @@ class EditInEditor extends Core {
unlink($page_tmp); unlink($page_tmp);
//save page //save page
$minor = $this->askOperator('Minor? [y/N/a]:'); $minor = $this->askOperator('Minor? [y/N/a]:');
if (($minor==='a') || ($minor==='A')) { if (($minor === 'a') || ($minor === 'A')) {
echo "aborted edit …\n"; echo "aborted edit …\n";
} else if (($minor==='y') || ($minor==='Y') || ($minor==='yes') || ($minor==='Yes')) { } else if (($minor === 'y') || ($minor === 'Y') || ($minor === 'yes') || ($minor === 'Yes')) {
$this->editPageMinor($pagename, $pagecontent, $this->askOperator('Edit Summary:')); $this->editPageMinor($pagename, $pagecontent, $this->askOperator('Edit Summary:'));
echo "saved minor edit …\n"; echo "saved minor edit …\n";
} else { } else {
...@@ -38,12 +38,12 @@ class EditInEditor extends Core { ...@@ -38,12 +38,12 @@ class EditInEditor extends Core {
echo "saved edit …\n"; echo "saved edit …\n";
} }
$continue = $this->askOperator("Continue? [y/N]"); $continue = $this->askOperator("Continue? [y/N]");
if (($continue==='y') || ($continue==='Y') || ($continue==='yes') || ($continue==='Yes')) { if (($continue === 'y') || ($continue === 'Y') || ($continue === 'yes') || ($continue === 'Yes')) {
$exit = false; $exit = false;
} else { } else {
$exit = true; $exit = true;
} }
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment