forked from Cavemanon/cavepaintings
PHP7 type annotations
This commit is contained in:
@@ -16,11 +16,7 @@ class AddAliasEvent extends Event {
|
||||
/** @var string */
|
||||
public $newtag;
|
||||
|
||||
/**
|
||||
* @param string $oldtag
|
||||
* @param string $newtag
|
||||
*/
|
||||
public function __construct($oldtag, $newtag) {
|
||||
public function __construct(string $oldtag, string $newtag) {
|
||||
$this->oldtag = trim($oldtag);
|
||||
$this->newtag = trim($newtag);
|
||||
}
|
||||
@@ -131,11 +127,7 @@ class AliasEditor extends Extension {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Database $database
|
||||
* @return string
|
||||
*/
|
||||
private function get_alias_csv(Database $database) {
|
||||
private function get_alias_csv(Database $database): string {
|
||||
$csv = "";
|
||||
$aliases = $database->get_pairs("SELECT oldtag, newtag FROM aliases ORDER BY newtag");
|
||||
foreach($aliases as $old => $new) {
|
||||
@@ -144,11 +136,7 @@ class AliasEditor extends Extension {
|
||||
return $csv;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Database $database
|
||||
* @param string $csv
|
||||
*/
|
||||
private function add_alias_csv(Database $database, /*string*/ $csv) {
|
||||
private function add_alias_csv(Database $database, string $csv) {
|
||||
$csv = str_replace("\r", "\n", $csv);
|
||||
foreach(explode("\n", $csv) as $line) {
|
||||
$parts = str_getcsv($line);
|
||||
@@ -170,9 +158,8 @@ class AliasEditor extends Extension {
|
||||
* Add alias *after* mass tag editing, else the MTE will
|
||||
* search for the images and be redirected to the alias,
|
||||
* missing out the images tagged with the old tag.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function get_priority() {return 60;}
|
||||
public function get_priority(): int {return 60;}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user