Upgrade to 4.1.0

This commit is contained in:
Bastian Allgeier
2024-01-30 16:41:06 +01:00
parent 5c44c8fcfd
commit 9345fc1a0b
59 changed files with 678 additions and 274 deletions

View File

@@ -696,6 +696,10 @@ class Blueprint
return null;
}
if ($this->sections[$name] instanceof Section) {
return $this->sections[$name]; //@codeCoverageIgnore
}
// get all props
$props = $this->sections[$name];
@@ -703,7 +707,7 @@ class Blueprint
$props['model'] = $this->model();
// create a new section object
return new Section($props['type'], $props);
return $this->sections[$name] = new Section($props['type'], $props);
}
/**
@@ -713,7 +717,10 @@ class Blueprint
{
return A::map(
$this->sections,
fn ($section) => $this->section($section['name'])
fn ($section) => match (true) {
$section instanceof Section => $section,
default => $this->section($section['name'])
}
);
}