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
<?php
include './Core/BotCore.php';
/** AnserWikiBrowser.php
require './Core/BotCore.php';
/** AnserWikiBrowser.php
* Opens a page in a user-defined editor and let’s you do things.
* @Author KPFC
* @Author KPFC
* @Version 0.1
* @Status Alpha
*/
class AnserWikiBrowser extends Core {
public function AnserWikiBrowser ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS = true); //login
*/
class AnserWikiBrowser extends Core {
public function __construct ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS); //login
//ask for editor to use
$editor = $this->askOperator('Enter your favorit text editor:');
if (!$editor) {
......@@ -84,5 +84,5 @@ class AnserWikiBrowser extends Core {
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
<?php
include './Core/BotCore.php';
/** EditInEditor.php
require './Core/BotCore.php';
/** EditInEditor.php
* Opens a page in a user-defined editor and saves the page after closing the editor
* @Author KPFC
* @Author KPFC
* @Version 0.1
* @Status Alpha
*/
class EditInEditor extends Core {
public function EditInEditor ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS = true); //login
*/
class EditInEditor extends Core {
public function __construct ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS); //login
//ask for editor to use
// $editor = $this->askOperator('Enter your favorit text editor:');
// if (!$editor) {
......@@ -28,9 +28,9 @@ class EditInEditor extends Core {
unlink($page_tmp);
//save page
$minor = $this->askOperator('Minor? [y/N/a]:');
if (($minor==='a') || ($minor==='A')) {
if (($minor === 'a') || ($minor === 'A')) {
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:'));
echo "saved minor edit …\n";
} else {
......@@ -38,12 +38,12 @@ class EditInEditor extends Core {
echo "saved edit …\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;
} else {
$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