Upgrade to 3.5.5
This commit is contained in:
@@ -30,14 +30,14 @@ class Site extends ModelWithContent
|
||||
/**
|
||||
* The SiteBlueprint object
|
||||
*
|
||||
* @var SiteBlueprint
|
||||
* @var \Kirby\Cms\SiteBlueprint
|
||||
*/
|
||||
protected $blueprint;
|
||||
|
||||
/**
|
||||
* The error page object
|
||||
*
|
||||
* @var Page
|
||||
* @var \Kirby\Cms\Page
|
||||
*/
|
||||
protected $errorPage;
|
||||
|
||||
@@ -52,7 +52,7 @@ class Site extends ModelWithContent
|
||||
/**
|
||||
* The home page object
|
||||
*
|
||||
* @var Page
|
||||
* @var \Kirby\Cms\Page
|
||||
*/
|
||||
protected $homePage;
|
||||
|
||||
@@ -74,7 +74,7 @@ class Site extends ModelWithContent
|
||||
/**
|
||||
* The current page object
|
||||
*
|
||||
* @var Page
|
||||
* @var \Kirby\Cms\Page
|
||||
*/
|
||||
protected $page;
|
||||
|
||||
@@ -142,7 +142,7 @@ class Site extends ModelWithContent
|
||||
|
||||
/**
|
||||
* Makes it possible to convert the site model
|
||||
* to a string. Mostly useful for debugging
|
||||
* to a string. Mostly useful for debugging.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -208,7 +208,7 @@ class Site extends ModelWithContent
|
||||
* @param string|null $languageCode
|
||||
* @return array
|
||||
*/
|
||||
public function contentFileData(array $data, string $languageCode = null): array
|
||||
public function contentFileData(array $data, ?string $languageCode = null): array
|
||||
{
|
||||
return A::prepend($data, [
|
||||
'title' => $data['title'] ?? null,
|
||||
@@ -360,11 +360,15 @@ class Site extends ModelWithContent
|
||||
*
|
||||
* @param string|null $format
|
||||
* @param string|null $handler
|
||||
* @return mixed
|
||||
* @return int|string
|
||||
*/
|
||||
public function modified(string $format = null, string $handler = null)
|
||||
public function modified(?string $format = null, ?string $handler = null)
|
||||
{
|
||||
return Dir::modified($this->root(), $format, $handler ?? $this->kirby()->option('date.handler', 'date'));
|
||||
return Dir::modified(
|
||||
$this->root(),
|
||||
$format,
|
||||
$handler ?? $this->kirby()->option('date.handler', 'date')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -376,10 +380,11 @@ class Site extends ModelWithContent
|
||||
* prop, the home page will be returned if
|
||||
* it can be found. (see `Site::homePage()`)
|
||||
*
|
||||
* @param string|null $path
|
||||
* @param string|null $path omit for current page,
|
||||
* otherwise e.g. `notes/across-the-ocean`
|
||||
* @return \Kirby\Cms\Page|null
|
||||
*/
|
||||
public function page(string $path = null)
|
||||
public function page(?string $path = null)
|
||||
{
|
||||
if ($path !== null) {
|
||||
return $this->find($path);
|
||||
@@ -496,7 +501,7 @@ class Site extends ModelWithContent
|
||||
* @param array $params
|
||||
* @return \Kirby\Cms\Pages
|
||||
*/
|
||||
public function search(string $query = null, $params = [])
|
||||
public function search(?string $query = null, $params = [])
|
||||
{
|
||||
return $this->index()->search($query, $params);
|
||||
}
|
||||
@@ -505,9 +510,9 @@ class Site extends ModelWithContent
|
||||
* Sets the Blueprint object
|
||||
*
|
||||
* @param array|null $blueprint
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
protected function setBlueprint(array $blueprint = null)
|
||||
protected function setBlueprint(?array $blueprint = null)
|
||||
{
|
||||
if ($blueprint !== null) {
|
||||
$blueprint['model'] = $this;
|
||||
@@ -524,7 +529,7 @@ class Site extends ModelWithContent
|
||||
* else is set.
|
||||
*
|
||||
* @param string $id
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
protected function setErrorPageId(string $id = 'error')
|
||||
{
|
||||
@@ -539,7 +544,7 @@ class Site extends ModelWithContent
|
||||
* else is set.
|
||||
*
|
||||
* @param string $id
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
protected function setHomePageId(string $id = 'home')
|
||||
{
|
||||
@@ -552,9 +557,9 @@ class Site extends ModelWithContent
|
||||
*
|
||||
* @internal
|
||||
* @param \Kirby\Cms\Page|null $page
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
public function setPage(Page $page = null)
|
||||
public function setPage(?Page $page = null)
|
||||
{
|
||||
$this->page = $page;
|
||||
return $this;
|
||||
@@ -564,7 +569,7 @@ class Site extends ModelWithContent
|
||||
* Sets the Url
|
||||
*
|
||||
* @param string|null $url
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
protected function setUrl($url = null)
|
||||
{
|
||||
@@ -615,7 +620,7 @@ class Site extends ModelWithContent
|
||||
* @param array|null $options
|
||||
* @return string
|
||||
*/
|
||||
public function urlForLanguage(string $languageCode = null, array $options = null): string
|
||||
public function urlForLanguage(?string $languageCode = null, ?array $options = null): string
|
||||
{
|
||||
if ($language = $this->kirby()->language($languageCode)) {
|
||||
return $language->url();
|
||||
@@ -634,7 +639,7 @@ class Site extends ModelWithContent
|
||||
* @param string|null $languageCode
|
||||
* @return \Kirby\Cms\Page
|
||||
*/
|
||||
public function visit($page, string $languageCode = null)
|
||||
public function visit($page, ?string $languageCode = null)
|
||||
{
|
||||
if ($languageCode !== null) {
|
||||
$this->kirby()->setCurrentTranslation($languageCode);
|
||||
|
Reference in New Issue
Block a user