@@ -19,7 +19,7 @@ public static function lazy($factory)
1919 return new LazyPromise ($ factory );
2020 }
2121
22- public static function all ($ promisesOrValues , $ onFulfilled = null , $ onRejected = null , $ onProgress = null )
22+ public static function all ($ promisesOrValues , callable $ onFulfilled = null , callable $ onRejected = null , callable $ onProgress = null )
2323 {
2424 $ promise = static ::map ($ promisesOrValues , function ($ val ) {
2525 return $ val ;
@@ -28,7 +28,7 @@ public static function all($promisesOrValues, $onFulfilled = null, $onRejected =
2828 return $ promise ->then ($ onFulfilled , $ onRejected , $ onProgress );
2929 }
3030
31- public static function any ($ promisesOrValues , $ onFulfilled = null , $ onRejected = null , $ onProgress = null )
31+ public static function any ($ promisesOrValues , callable $ onFulfilled = null , callable $ onRejected = null , callable $ onProgress = null )
3232 {
3333 $ unwrapSingleResult = function ($ val ) use ($ onFulfilled ) {
3434 $ val = array_shift ($ val );
@@ -39,7 +39,7 @@ public static function any($promisesOrValues, $onFulfilled = null, $onRejected =
3939 return static ::some ($ promisesOrValues , 1 , $ unwrapSingleResult , $ onRejected , $ onProgress );
4040 }
4141
42- public static function some ($ promisesOrValues , $ howMany , $ onFulfilled = null , $ onRejected = null , $ onProgress = null )
42+ public static function some ($ promisesOrValues , $ howMany , callable $ onFulfilled = null , callable $ onRejected = null , callable $ onProgress = null )
4343 {
4444 return When::resolve ($ promisesOrValues )->then (function ($ array ) use ($ howMany , $ onFulfilled , $ onRejected , $ onProgress ) {
4545 if (!is_array ($ array )) {
@@ -104,7 +104,7 @@ public static function some($promisesOrValues, $howMany, $onFulfilled = null, $o
104104 });
105105 }
106106
107- public static function map ($ promisesOrValues , $ mapFunc )
107+ public static function map ($ promisesOrValues , callable $ mapFunc )
108108 {
109109 return When::resolve ($ promisesOrValues )->then (function ($ array ) use ($ mapFunc ) {
110110 if (!is_array ($ array )) {
@@ -142,7 +142,7 @@ function ($mapped) use (&$values, $i, &$toResolve, $deferred) {
142142 });
143143 }
144144
145- public static function reduce ($ promisesOrValues , $ reduceFunc , $ initialValue = null )
145+ public static function reduce ($ promisesOrValues , callable $ reduceFunc , $ initialValue = null )
146146 {
147147 return When::resolve ($ promisesOrValues )->then (function ($ array ) use ($ reduceFunc , $ initialValue ) {
148148 if (!is_array ($ array )) {
0 commit comments