@@ -93,7 +93,7 @@ public static function fromArraysValue($array, $key)
93
93
*/
94
94
public static function fromReturn ($ callback , array $ arguments = [], $ noneValue = null )
95
95
{
96
- return new LazyOption (function () use ($ callback , $ arguments , $ noneValue ) {
96
+ return new LazyOption (static function () use ($ callback , $ arguments , $ noneValue ) {
97
97
/** @var mixed */
98
98
$ return = call_user_func_array ($ callback , $ arguments );
99
99
@@ -126,7 +126,7 @@ public static function ensure($value, $noneValue = null)
126
126
if ($ value instanceof self) {
127
127
return $ value ;
128
128
} elseif (is_callable ($ value )) {
129
- return new LazyOption (function () use ($ value , $ noneValue ) {
129
+ return new LazyOption (static function () use ($ value , $ noneValue ) {
130
130
/** @var mixed */
131
131
$ return = $ value ();
132
132
@@ -159,14 +159,14 @@ public static function ensure($value, $noneValue = null)
159
159
*/
160
160
public static function lift ($ callback , $ noneValue = null )
161
161
{
162
- return function () use ($ callback , $ noneValue ) {
162
+ return static function () use ($ callback , $ noneValue ) {
163
163
/** @var array<int, mixed> */
164
164
$ args = func_get_args ();
165
165
166
166
$ reduced_args = array_reduce (
167
167
$ args ,
168
168
/** @param bool $status */
169
- function ($ status , self $ o ) {
169
+ static function ($ status , self $ o ) {
170
170
return $ o ->isEmpty () ? true : $ status ;
171
171
},
172
172
false
@@ -178,7 +178,7 @@ function ($status, self $o) {
178
178
179
179
$ args = array_map (
180
180
/** @return T */
181
- function (self $ o ) {
181
+ static function (self $ o ) {
182
182
// it is safe to do so because the fold above checked
183
183
// that all arguments are of type Some
184
184
/** @var T */
0 commit comments