diff --git a/core/Config.php b/core/Config.php index e621fbb..780e72c 100644 --- a/core/Config.php +++ b/core/Config.php @@ -89,7 +89,7 @@ public static function get ( $key, $default = null ) { } /** - * @return positive-int + * @return int<0, max> */ public static function get_size () { return count( self::$values ); diff --git a/core/Dependencies.php b/core/Dependencies.php index df8445b..f469986 100644 --- a/core/Dependencies.php +++ b/core/Dependencies.php @@ -43,7 +43,7 @@ public static function maybe_start_plugin () { } /** - * @return array{success: bool, messages: string[]} The result + * @return array{success: bool, messages: array} * @throws \Exception */ public static function check_dependencies () { @@ -124,7 +124,7 @@ protected static function handle_shortcut ( $shortcut ) { } /** - * @param string[] $messages + * @param array $messages * @return void */ protected static function display_notice_missing_deps ( $messages ) { @@ -132,20 +132,23 @@ protected static function display_notice_missing_deps ( $messages ) { if ( ! \current_user_can( 'install_plugins' ) ) return; if ( 0 === count( $messages ) ) return; - \usort( $messages, function ( $a, $b ) { - return $b['is_error'] <=> $a['is_error']; - } ); + \usort( + $messages, + function ( $a, $b ) { + return $b['is_error'] <=> $a['is_error']; + } + ); \add_action( 'admin_notices', function () use ( $messages ) { echo "

"; echo sprintf( /* translators: %s is replaced with plugin name */ - __( 'The %s plugin needs the following dependencies to work:', 'your_text_domain' ), + __( 'The %s plugin needs the following dependencies to work:', 'wc-shipping-simulator' ), "" . Config::get( 'NAME' ) . "", ); $indent = \str_repeat( ' ', 4 ); - $missing = esc_html__( 'Missing', 'your_text_domain' ); + $missing = esc_html__( 'Missing', 'wc-shipping-simulator' ); $allowed_html = [ 'a' => [ 'href' => [], 'target' => [] ], 'span' => [ 'class' => [], 'style' => [] ], diff --git a/core/Traits/Debug_Helpers.php b/core/Traits/Debug_Helpers.php index ed50020..fc57a42 100644 --- a/core/Traits/Debug_Helpers.php +++ b/core/Traits/Debug_Helpers.php @@ -10,7 +10,7 @@ trait Debug_Helpers { * Dump and die * * @param mixed ...$values - * @return null|never + * @return void|never */ public static function dd ( ...$values ) { if ( ! WP_DEBUG ) return; diff --git a/core/Traits/String_Helpers.php b/core/Traits/String_Helpers.php index 4007f10..9cb1223 100644 --- a/core/Traits/String_Helpers.php +++ b/core/Traits/String_Helpers.php @@ -7,7 +7,7 @@ trait String_Helpers { /** * @param string $string * @param string $encoding - * @return string + * @return int<0, max> */ public static function str_length ( $string, $encoding = 'UTF-8' ) { return \mb_strlen( $string, $encoding ); @@ -34,7 +34,7 @@ public static function str_upper ( $string, $encoding = 'UTF-8' ) { /** * @param string $string * @param string $encoding - * @return string + * @return bool */ public static function str_contains ( $string, $search, $encoding = 'UTF-8' ) { return $search !== '' && mb_strpos( $string, $search, 0, $encoding ) !== false; diff --git a/core/Traits/Throw_Helpers.php b/core/Traits/Throw_Helpers.php index 81142aa..9c49511 100644 --- a/core/Traits/Throw_Helpers.php +++ b/core/Traits/Throw_Helpers.php @@ -15,7 +15,7 @@ public static function get_error_class () { * If the condition is falsy, throws a Exception. * * @param bool $condition - * @param string $message + * @param callable|mixed $message * @param \Throwable|null $exception_class * @return void * @throws \Throwable diff --git a/core/VERSION b/core/VERSION index 227cea2..38f77a6 100644 --- a/core/VERSION +++ b/core/VERSION @@ -1 +1 @@ -2.0.0 +2.0.1