@@ -874,7 +874,7 @@ protected function createRequest($component, $destination, array $args, $mode)
874874 throw new InvalidLinkException ("Unknown signal ' $ signal', missing handler {$ reflection ->getName ()}:: $ method() " );
875875 }
876876 // convert indexed parameters to named
877- self ::argsToParams (get_class ($ component ), $ method , $ args );
877+ self ::argsToParams (get_class ($ component ), $ method , $ args, [], $ mode === ' test ' );
878878 }
879879
880880 // counterpart of IStatePersistent
@@ -915,12 +915,8 @@ protected function createRequest($component, $destination, array $args, $mode)
915915 if (array_key_exists (0 , $ args )) {
916916 throw new InvalidLinkException ("Unable to pass parameters to action ' $ presenter: $ action', missing corresponding method. " );
917917 }
918-
919- } elseif ($ destination === 'this ' ) {
920- self ::argsToParams ($ presenterClass , $ method , $ args , $ this ->params );
921-
922918 } else {
923- self ::argsToParams ($ presenterClass , $ method , $ args );
919+ self ::argsToParams ($ presenterClass , $ method , $ args, $ destination === ' this ' ? $ this -> params : [], $ mode === ' test ' );
924920 }
925921
926922 // counterpart of IStatePersistent
@@ -1004,11 +1000,12 @@ protected function createRequest($component, $destination, array $args, $mode)
10041000 * @param string method name
10051001 * @param array arguments
10061002 * @param array supplemental arguments
1003+ * @param bool prevents 'Missing parameter' exception
10071004 * @return void
10081005 * @throws InvalidLinkException
10091006 * @internal
10101007 */
1011- public static function argsToParams ($ class , $ method , & $ args , $ supplemental = [])
1008+ public static function argsToParams ($ class , $ method , & $ args , $ supplemental = [], $ ignoreMissing = FALSE )
10121009 {
10131010 $ i = 0 ;
10141011 $ rm = new \ReflectionMethod ($ class , $ method );
@@ -1029,7 +1026,7 @@ public static function argsToParams($class, $method, & $args, $supplemental = []
10291026 }
10301027
10311028 if (!isset ($ args [$ name ])) {
1032- if ($ param ->isDefaultValueAvailable () || $ type === 'NULL ' || $ type === 'array ' ) {
1029+ if ($ param ->isDefaultValueAvailable () || $ type === 'NULL ' || $ type === 'array ' || $ ignoreMissing ) {
10331030 continue ;
10341031 }
10351032 throw new InvalidLinkException ("Missing parameter \$$ name required by $ class:: {$ rm ->getName ()}() " );
0 commit comments