the php string type is lowercase

This commit is contained in:
Shish 2023-08-17 18:12:36 +01:00 committed by Shish
parent e2dba09353
commit aa8de9d420
10 changed files with 30 additions and 29 deletions

View file

@ -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");

View file

@ -219,7 +219,7 @@ class Image
/**
* 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 @@ class Image
/**
* 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 @@ class Image
* 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 @@ class Image
/**
* The reverse of get_next
*
* @param String[] $tags
* @param string[] $tags
*/
public function get_prev(array $tags=[]): ?Image
{
@ -427,7 +427,7 @@ class Image
/**
* 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 @@ class Image
}
/**
* @param String[] $terms
* @param string[] $terms
*/
private static function build_search_querylet(
array $terms,

View file

@ -122,6 +122,7 @@ class Tag
return $id;
}
/** @param string[] $tags */
public static function implode(array $tags): string
{
sort($tags, SORT_FLAG_CASE|SORT_STRING);

View file

@ -264,7 +264,7 @@ class AutoTagger extends Extension
}
}
private function remove_auto_tag(String $tag)
private function remove_auto_tag(string $tag)
{
global $database;

View file

@ -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 @@ class BulkActions extends Extension
return $total;
}
private function set_source(iterable $items, String $source): int
private function set_source(iterable $items, string $source): int
{
global $page;
$total = 0;

View file

@ -23,7 +23,7 @@ class HelpPagesTheme extends Themelet
$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;

View file

@ -457,8 +457,8 @@ class Media extends Extension
// }
// 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 @@ class Media extends Extension
/**
* 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

View file

@ -83,7 +83,7 @@ class MimeType
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 @@ class MimeType
/**
* 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 @@ class MimeType
/**
* 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
{

View file

@ -72,12 +72,12 @@ class TranscodeImage extends Extension
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 @@ class TranscodeImage extends Extension
}
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 @@ class TranscodeImage extends Extension
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 @@ class TranscodeImage extends Extension
}
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 @@ class TranscodeImage extends Extension
}
}
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 @@ class TranscodeImage extends Extension
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;

View file

@ -180,7 +180,7 @@ class TranscodeVideo extends Extension
}
}
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 @@ class TranscodeVideo extends Extension
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 @@ class TranscodeVideo extends Extension
}
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;