Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Feb 6, 2024
1 parent cb36c47 commit 05ec593
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions VoteCounter/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function deleteRequireFunctions($str) {

function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_API_URL, $WIKIPEDIA_USERNAME, $WIKIPEDIA_PASSWORD) {
// clear cookies from last session
$file = fopen($ABSOLUTE_PATH_TO_TEMP_DIRECTORY . '\\cookie.txt', 'w') or die ('Unable to open file!');
$file = fopen($ABSOLUTE_PATH_TO_TEMP_DIRECTORY . '\\cookie.txt', 'w') or die('Unable to open file!');
fwrite($file, '');
fclose($file);

Expand Down Expand Up @@ -73,7 +73,7 @@ function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_A
'type' => 'csrf',
];
$csrfToken = apiSendAndReceive($apiData, $WIKIPEDIA_API_URL, $ABSOLUTE_PATH_TO_TEMP_DIRECTORY)['query']['tokens']['csrftoken'];

// make edit
$apiData = [
'action' => 'edit',
Expand All @@ -95,8 +95,12 @@ function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {

$files = scandir($CLASSES_FOLDER_PATH);
foreach ( $files as $fileName ) {
if ( $fileName === '.' ) continue;
if ( $fileName === '..' ) continue;
if ( $fileName === '.' ) {
continue;
}
if ( $fileName === '..' ) {
continue;
}
$path = $CLASSES_FOLDER_PATH . $fileName;
$classText = file_get_contents($path);
$wikitext .= "\n\n// === $path ======================================================\n\n" . $classText;
Expand Down

0 comments on commit 05ec593

Please sign in to comment.