Upgrade to 4.0.0
This commit is contained in:
@@ -27,18 +27,19 @@ class Asset
|
||||
/**
|
||||
* Relative file path
|
||||
*/
|
||||
protected string|null $path = null;
|
||||
protected string|null $path;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new Asset object for the given path.
|
||||
*/
|
||||
public function __construct(string $path)
|
||||
{
|
||||
$this->setProperties([
|
||||
'path' => dirname($path),
|
||||
'root' => $this->kirby()->root('index') . '/' . $path,
|
||||
'url' => $this->kirby()->url('base') . '/' . $path
|
||||
]);
|
||||
$this->root = $this->kirby()->root('index') . '/' . $path;
|
||||
$this->url = $this->kirby()->url('base') . '/' . $path;
|
||||
|
||||
$path = dirname($path);
|
||||
$this->path = $path === '.' ? '' : $path;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +47,7 @@ class Asset
|
||||
*
|
||||
* @throws \Kirby\Exception\BadMethodCallException
|
||||
*/
|
||||
public function __call(string $method, array $arguments = [])
|
||||
public function __call(string $method, array $arguments = []): mixed
|
||||
{
|
||||
// public property access
|
||||
if (isset($this->$method) === true) {
|
||||
@@ -114,15 +115,4 @@ class Asset
|
||||
{
|
||||
return $this->path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for the path
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
protected function setPath(string $path): static
|
||||
{
|
||||
$this->path = $path === '.' ? '' : $path;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user