Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Structures/Collections/ArrayCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private function getProperty(mixed $target, string|int $keyName, bool $throwOnMi
* @return static
* @psalm-return static<TKey,T>
*/
public function filter(Closure $func = null): static
public function filter(?Closure $func = null): static
{
return $this->createFrom(array_filter($this->elements, $func, ARRAY_FILTER_USE_BOTH));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/HasPrePostActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function addCallbackAction(string $key, callable $action): self
return $this;
}

public function getCallbackActions(string $key = null): array
public function getCallbackActions(?string $key = null): array
{
return $key ?
$this->executeCallbacks[$key] ?? []
Expand Down
6 changes: 5 additions & 1 deletion src/Traits/UseStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
*/
trait UseStorage
{
private Storage $storage;
private Storage $storage {
get {
return $this->storage ??= new Storage();
}
}

protected function propertyExists(string $name): bool
{
Expand Down