update kirby
This commit is contained in:
parent
652262ac94
commit
9c662bcbba
165 changed files with 1757 additions and 598 deletions
|
|
@ -54,7 +54,7 @@ class Content
|
|||
*/
|
||||
public function __construct(
|
||||
array $data = [],
|
||||
ModelWithContent $parent = null,
|
||||
ModelWithContent|null $parent = null,
|
||||
bool $normalize = true
|
||||
) {
|
||||
if ($normalize === true) {
|
||||
|
|
@ -149,7 +149,7 @@ class Content
|
|||
* Returns either a single field object
|
||||
* or all registered fields
|
||||
*/
|
||||
public function get(string $key = null): Field|array
|
||||
public function get(string|null $key = null): Field|array
|
||||
{
|
||||
if ($key === null) {
|
||||
return $this->fields();
|
||||
|
|
@ -234,7 +234,7 @@ class Content
|
|||
* @return $this
|
||||
*/
|
||||
public function update(
|
||||
array $content = null,
|
||||
array|null $content = null,
|
||||
bool $overwrite = false
|
||||
): static {
|
||||
$content = array_change_key_case((array)$content, CASE_LOWER);
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class ContentTranslation
|
|||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function update(array $data = null, bool $overwrite = false): static
|
||||
public function update(array|null $data = null, bool $overwrite = false): static
|
||||
{
|
||||
$data = array_change_key_case((array)$data);
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ class Field
|
|||
* the modified field will be returned. Otherwise it
|
||||
* will return the field value.
|
||||
*/
|
||||
public function value(string|Closure $value = null): mixed
|
||||
public function value(string|Closure|null $value = null): mixed
|
||||
{
|
||||
if ($value === null) {
|
||||
return $this->value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue