| 1 | <?php  | 
            ||
| 23 | class RedirectAction extends \yii\base\Action  | 
            ||
| 24 | { | 
            ||
| 25 | /**  | 
            ||
| 26 | * @var string|array url to redirect to  | 
            ||
| 27 | */  | 
            ||
| 28 | protected $_url;  | 
            ||
| 29 | |||
| 30 | /**  | 
            ||
| 31 | * Collects the URL array, executing callable functions.  | 
            ||
| 32 | * @return string|array default return to previous page (referer)  | 
            ||
| 33 | */  | 
            ||
| 34 | public function getUrl()  | 
            ||
| 42 | |||
| 43 | /**  | 
            ||
| 44 | * @param $url  | 
            ||
| 45 | */  | 
            ||
| 46 | public function setUrl($url)  | 
            ||
| 50 | |||
| 51 | public function run()  | 
            ||
| 57 | }  | 
            ||
| 58 | 
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: