Skip to content

Instantly share code, notes, and snippets.

@iluuu1994
Created March 24, 2022 20:16
Show Gist options
  • Save iluuu1994/af2c3c75b6a2cb6c7a846c78bac82c46 to your computer and use it in GitHub Desktop.
Save iluuu1994/af2c3c75b6a2cb6c7a846c78bac82c46 to your computer and use it in GitHub Desktop.
Accessors for arrays
<?php
class Foo {
public array $bar {
get;
/**
* @param list<string> $path
* @param \Closure(list<string> $path, mixed $value, bool $unset): void $update
*/
update(array $path, mixed $value, bool $unset, \Closure $update) {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment