Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the php string type is lowercase #950

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/command_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CommandBuilder
private array $args = [];
public array $output;

public function __construct(String $executable)
public function __construct(string $executable)
{
if (empty($executable)) {
throw new \InvalidArgumentException("executable cannot be empty");
Expand Down
12 changes: 6 additions & 6 deletions core/imageboard/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public static function count_tag(string $tag): int
/**
* Count the number of image results for a given search
*
* @param String[] $tags
* @param string[] $tags
*/
public static function count_images(array $tags=[]): int
{
Expand Down Expand Up @@ -264,7 +264,7 @@ public static function count_images(array $tags=[]): int
/**
* Count the number of pages for a given search
*
* @param String[] $tags
* @param string[] $tags
*/
public static function count_pages(array $tags=[]): int
{
Expand All @@ -282,7 +282,7 @@ public static function count_pages(array $tags=[]): int
* Rather than simply $this_id + 1, one must take into account
* deleted images and search queries
*
* @param String[] $tags
* @param string[] $tags
*/
public function get_next(array $tags=[], bool $next=true): ?Image
{
Expand Down Expand Up @@ -318,7 +318,7 @@ public function get_next(array $tags=[], bool $next=true): ?Image
/**
* The reverse of get_next
*
* @param String[] $tags
* @param string[] $tags
*/
public function get_prev(array $tags=[]): ?Image
{
Expand Down Expand Up @@ -427,7 +427,7 @@ public function save_to_db()
/**
* Get this image's tags as an array.
*
* @return String[]
* @return string[]
*/
#[Field(name: "tags", type: "[string!]!")]
public function get_tag_array(): array
Expand Down Expand Up @@ -749,7 +749,7 @@ private static function tag_or_wildcard_to_ids(string $tag): array
}

/**
* @param String[] $terms
* @param string[] $terms
*/
private static function build_search_querylet(
array $terms,
Expand Down
1 change: 1 addition & 0 deletions core/imageboard/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public static function get_or_create_id(string $tag): int
return $id;
}

/** @param string[] $tags */
public static function implode(array $tags): string
{
sort($tags, SORT_FLAG_CASE|SORT_STRING);
Expand Down
2 changes: 1 addition & 1 deletion ext/auto_tagger/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private function apply_new_auto_tag(string $tag)
}
}

private function remove_auto_tag(String $tag)
private function remove_auto_tag(string $tag)
{
global $database;

Expand Down
6 changes: 3 additions & 3 deletions ext/bulk_actions/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BulkActionBlockBuildingEvent extends Event
public array $actions = [];
public array $search_terms = [];

public function add_action(String $action, string $button_text, string $access_key = null, string $confirmation_message = "", string $block = "", int $position = 40)
public function add_action(string $action, string $button_text, string $access_key = null, string $confirmation_message = "", string $block = "", int $position = 40)
{
if (!empty($access_key)) {
assert(strlen($access_key)==1);
Expand Down Expand Up @@ -40,7 +40,7 @@ class BulkActionEvent extends Event
public \Generator $items;
public bool $redirect = true;

public function __construct(String $action, \Generator $items)
public function __construct(string $action, \Generator $items)
{
parent::__construct();
$this->action = $action;
Expand Down Expand Up @@ -285,7 +285,7 @@ private function tag_items(iterable $items, string $tags, bool $replace): int
return $total;
}

private function set_source(iterable $items, String $source): int
private function set_source(iterable $items, string $source): int
{
global $page;
$total = 0;
Expand Down
2 changes: 1 addition & 1 deletion ext/help_pages/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function display_list_page(array $pages)
$page->add_block(new Block("Help Pages", "See list of pages to left"));
}

public function display_help_page(String $title)
public function display_help_page(string $title)
{
global $page;

Expand Down
6 changes: 3 additions & 3 deletions ext/media/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ public static function determine_ext(string $mime): string
// }

// public static function image_resize_imagick(
// String $input_path,
// String $input_type,
// string $input_path,
// string $input_type,
// int $new_width,
// int $new_height,
// string $output_filename,
Expand Down Expand Up @@ -631,7 +631,7 @@ public static function image_resize_convert(
/**
* Performs a resize operation on an image file using GD.
*
* @param String $image_filename The source file to be resized.
* @param string $image_filename The source file to be resized.
* @param array $info The output of getimagesize() for the source file.
* @param int $new_width
* @param int $new_height
Expand Down
8 changes: 4 additions & 4 deletions ext/mime/mime_type.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static function is_mime(string $value): bool
return preg_match(self::REGEX_MIME_TYPE, $value)===1;
}

public static function add_parameters(String $mime, String...$parameters): string
public static function add_parameters(string $mime, string ...$parameters): string
{
if (empty($parameters)) {
return $mime;
Expand Down Expand Up @@ -128,7 +128,7 @@ public static function matches(string $mime1, string $mime2, bool $exact = false
/**
* Determines if a file is an animated gif.
*
* @param String $image_filename The path of the file to check.
* @param string $image_filename The path of the file to check.
* @return bool true if the file is an animated gif, false if it is not.
*/
public static function is_animated_gif(string $image_filename): bool
Expand Down Expand Up @@ -214,8 +214,8 @@ public static function get_for_extension(string $ext): ?string

/**
* Returns the mimetype for the specified file via file inspection
* @param String $file
* @return String The mimetype that was found. Returns generic octet binary mimetype if not found.
* @param string $file
* @return string The mimetype that was found. Returns generic octet binary mimetype if not found.
*/
public static function get_for_file(string $file, ?string $ext = null): string
{
Expand Down
14 changes: 7 additions & 7 deletions ext/transcode/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ private static function get_mapping_name(string $mime): string
return TranscodeConfig::UPLOAD_PREFIX.$mime;
}

private static function get_mapping(String $mime): ?string
private static function get_mapping(string $mime): ?string
{
global $config;
return $config->get_string(self::get_mapping_name($mime));
}
private static function set_mapping(String $from_mime, ?String $to_mime): void
private static function set_mapping(string $from_mime, ?string $to_mime): void
{
global $config;
$config->set_string(self::get_mapping_name($from_mime), $to_mime);
Expand Down Expand Up @@ -333,7 +333,7 @@ private function can_convert_mime($engine, $mime): bool
}


private function get_supported_output_mimes($engine, ?String $omit_mime = null): array
private function get_supported_output_mimes($engine, ?string $omit_mime = null): array
{
$output = [];

Expand All @@ -353,7 +353,7 @@ private function get_supported_output_mimes($engine, ?String $omit_mime = null):



private function transcode_and_replace_image(Image $image_obj, String $target_mime): Image
private function transcode_and_replace_image(Image $image_obj, string $target_mime): Image
{
$original_file = warehouse_path(Image::IMAGE_DIR, $image_obj->hash);

Expand Down Expand Up @@ -381,7 +381,7 @@ private function transcode_and_replace_image(Image $image_obj, String $target_mi
}


private function transcode_image(String $source_name, String $source_mime, string $target_mime): string
private function transcode_image(string $source_name, string $source_mime, string $target_mime): string
{
global $config;

Expand Down Expand Up @@ -410,7 +410,7 @@ private function transcode_image(String $source_name, String $source_mime, strin
}
}

private function transcode_image_gd(String $source_name, String $source_mime, string $target_mime): string
private function transcode_image_gd(string $source_name, string $source_mime, string $target_mime): string
{
global $config;

Expand Down Expand Up @@ -462,7 +462,7 @@ private function transcode_image_gd(String $source_name, String $source_mime, st
return $tmp_name;
}

private function transcode_image_convert(String $source_name, String $source_mime, string $target_mime): string
private function transcode_image_convert(string $source_name, string $source_mime, string $target_mime): string
{
global $config;

Expand Down
6 changes: 3 additions & 3 deletions ext/transcode_video/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function onBulkAction(BulkActionEvent $event)
}
}

private static function get_output_options(?String $starting_container = null, ?String $starting_codec = null): array
private static function get_output_options(?string $starting_container = null, ?string $starting_codec = null): array
{
$output = ["" => ""];

Expand All @@ -199,7 +199,7 @@ private static function get_output_options(?String $starting_container = null, ?
return $output;
}

private function transcode_and_replace_video(Image $image, String $target_mime): Image
private function transcode_and_replace_video(Image $image, string $target_mime): Image
{
if ($image->get_mime()==$target_mime) {
return $image;
Expand Down Expand Up @@ -243,7 +243,7 @@ private function transcode_and_replace_video(Image $image, String $target_mime):
}


private function transcode_video(String $source_file, String $source_video_codec, String $target_mime, string $target_file): string
private function transcode_video(string $source_file, string $source_video_codec, string $target_mime, string $target_file): string
{
global $config;

Expand Down