From 84248fc7c9b2eec58349a52ea1860be06c0f9338 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 17 Aug 2023 18:12:36 +0100 Subject: [PATCH] the php string type is lowercase --- core/command_builder.php | 2 +- core/imageboard/image.php | 12 ++++++------ core/imageboard/tag.php | 1 + ext/auto_tagger/main.php | 2 +- ext/bulk_actions/main.php | 6 +++--- ext/help_pages/theme.php | 2 +- ext/media/main.php | 6 +++--- ext/mime/mime_type.php | 8 ++++---- ext/transcode/main.php | 14 +++++++------- ext/transcode_video/main.php | 6 +++--- 10 files changed, 30 insertions(+), 29 deletions(-) diff --git a/core/command_builder.php b/core/command_builder.php index 34b4532ef..cd912bb33 100644 --- a/core/command_builder.php +++ b/core/command_builder.php @@ -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"); diff --git a/core/imageboard/image.php b/core/imageboard/image.php index df4e5de7b..b29d61ffc 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 @@ -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, diff --git a/core/imageboard/tag.php b/core/imageboard/tag.php index 0780aaaaf..e1c437db9 100644 --- a/core/imageboard/tag.php +++ b/core/imageboard/tag.php @@ -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); diff --git a/ext/auto_tagger/main.php b/ext/auto_tagger/main.php index d67c3cf32..224d8d9fa 100644 --- a/ext/auto_tagger/main.php +++ b/ext/auto_tagger/main.php @@ -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; diff --git a/ext/bulk_actions/main.php b/ext/bulk_actions/main.php index 19ce61adc..ae1193444 100644 --- a/ext/bulk_actions/main.php +++ b/ext/bulk_actions/main.php @@ -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); @@ -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; @@ -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; diff --git a/ext/help_pages/theme.php b/ext/help_pages/theme.php index 669d378f6..0a5fb6162 100644 --- a/ext/help_pages/theme.php +++ b/ext/help_pages/theme.php @@ -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; diff --git a/ext/media/main.php b/ext/media/main.php index 3af4cbedb..f3fce63be 100644 --- a/ext/media/main.php +++ b/ext/media/main.php @@ -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, @@ -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 diff --git a/ext/mime/mime_type.php b/ext/mime/mime_type.php index fbb0906fc..e778efb04 100644 --- a/ext/mime/mime_type.php +++ b/ext/mime/mime_type.php @@ -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; @@ -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 @@ -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 { diff --git a/ext/transcode/main.php b/ext/transcode/main.php index 5150eeda9..29ee67850 100644 --- a/ext/transcode/main.php +++ b/ext/transcode/main.php @@ -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); @@ -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 = []; @@ -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); @@ -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; @@ -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; @@ -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; diff --git a/ext/transcode_video/main.php b/ext/transcode_video/main.php index ad8b698ec..8235afea9 100644 --- a/ext/transcode_video/main.php +++ b/ext/transcode_video/main.php @@ -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 = ["" => ""]; @@ -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; @@ -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;