Skip to content

Commit

Permalink
[tag/source history] privatise some functions which are only used int…
Browse files Browse the repository at this point in the history
…ernally
  • Loading branch information
shish committed Dec 12, 2024
1 parent b87dc9f commit 76e88da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions ext/source_history/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private function process_revert_request(int $revert_id): void
$page->set_redirect(make_link('post/view/'.$stored_image_id));
}

protected function process_bulk_revert_request(): void
private function process_bulk_revert_request(): void
{
if (isset($_POST['revert_name']) && !empty($_POST['revert_name'])) {
$revert_name = $_POST['revert_name'];
Expand Down Expand Up @@ -212,7 +212,7 @@ protected function process_bulk_revert_request(): void
/**
* @return array<string, mixed>|null
*/
public function get_source_history_from_revert(int $revert_id): ?array
private function get_source_history_from_revert(int $revert_id): ?array
{
global $database;
$row = $database->get_row("
Expand All @@ -226,7 +226,7 @@ public function get_source_history_from_revert(int $revert_id): ?array
/**
* @return array<string, mixed>
*/
public function get_source_history_from_id(int $image_id): array
private function get_source_history_from_id(int $image_id): array
{
global $database;
return $database->get_all(
Expand All @@ -243,7 +243,7 @@ public function get_source_history_from_id(int $image_id): array
/**
* @return array<string, mixed>
*/
public function get_global_source_history(int $page_id): array
private function get_global_source_history(int $page_id): array
{
global $database;
return $database->get_all("
Expand All @@ -258,7 +258,7 @@ public function get_global_source_history(int $page_id): array
/**
* This function attempts to revert all changes by a given IP within an (optional) timeframe.
*/
public function process_revert_all_changes(?string $name, ?string $ip, ?string $date): void
private function process_revert_all_changes(?string $name, ?string $ip, ?string $date): void
{
global $database;

Expand Down
12 changes: 6 additions & 6 deletions ext/tag_history/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private function process_revert_request(int $revert_id): void
$page->set_redirect(make_link('post/view/'.$stored_image_id));
}

protected function process_bulk_revert_request(): void
private function process_bulk_revert_request(): void
{
if (isset($_POST['revert_name']) && !empty($_POST['revert_name'])) {
$revert_name = $_POST['revert_name'];
Expand Down Expand Up @@ -258,7 +258,7 @@ protected function process_bulk_revert_request(): void
/**
* @return array<string, mixed>|null
*/
public function get_tag_history_from_revert(int $revert_id): ?array
private function get_tag_history_from_revert(int $revert_id): ?array
{
global $database;
$row = $database->get_row("
Expand All @@ -272,7 +272,7 @@ public function get_tag_history_from_revert(int $revert_id): ?array
/**
* @return array<string, mixed>
*/
public function get_tag_history_from_id(int $image_id): array
private function get_tag_history_from_id(int $image_id): array
{
global $database;
return $database->get_all(
Expand All @@ -289,7 +289,7 @@ public function get_tag_history_from_id(int $image_id): array
/**
* @return array<string, mixed>
*/
public function get_global_tag_history(int $page_id): array
private function get_global_tag_history(int $page_id): array
{
global $database;
return $database->get_all("
Expand All @@ -304,7 +304,7 @@ public function get_global_tag_history(int $page_id): array
/**
* @return array<string, mixed>|null
*/
public function get_previous_tags(int $image_id, int $id): ?array
private function get_previous_tags(int $image_id, int $id): ?array

Check failure on line 307 in ext/tag_history/main.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Method Shimmie2\TagHistory::get_previous_tags() is unused.
{
global $database;
$row = $database->get_row("
Expand All @@ -320,7 +320,7 @@ public function get_previous_tags(int $image_id, int $id): ?array
/**
* This function attempts to revert all changes by a given IP within an (optional) timeframe.
*/
public function process_revert_all_changes(?string $name, ?string $ip, ?string $date): void
private function process_revert_all_changes(?string $name, ?string $ip, ?string $date): void
{
global $database;

Expand Down

0 comments on commit 76e88da

Please sign in to comment.