Upgrade to 3.8.0

This commit is contained in:
Bastian Allgeier
2022-10-06 10:11:54 +02:00
parent a9ed4e45ca
commit 7d168aae58
332 changed files with 26337 additions and 21977 deletions

View File

@@ -21,12 +21,10 @@ use Kirby\Http\Url as BaseUrl;
*/
class Url extends BaseUrl
{
public static $home = null;
public static string|null $home = null;
/**
* Returns the Url to the homepage
*
* @return string
*/
public static function home(): string
{
@@ -34,13 +32,10 @@ class Url extends BaseUrl
}
/**
* Creates an absolute Url to a template asset if it exists. This is used in the `css()` and `js()` helpers
*
* @param string $assetPath
* @param string $extension
* @return string|null
* Creates an absolute Url to a template asset if it exists.
* This is used in the `css()` and `js()` helpers
*/
public static function toTemplateAsset(string $assetPath, string $extension)
public static function toTemplateAsset(string $assetPath, string $extension): string|null
{
$kirby = App::instance();
$page = $kirby->site()->page();
@@ -54,11 +49,9 @@ class Url extends BaseUrl
/**
* Smart resolver for internal and external urls
*
* @param string|null $path
* @param array|string|null $options Either an array of options for the Uri class or a language string
* @return string
*/
public static function to(string $path = null, $options = null): string
public static function to(string|null $path = null, array|string|null $options = null): string
{
$kirby = App::instance();
return ($kirby->component('url'))($kirby, $path, $options);