udokmeci/yii2-beanstalk

Can't use tube named index

Closed this issue · 1 comments

We had a tube named index (to index records into elasticsearch), but since PHP7, that isn't possible anymore.

It seems that there is a actionIndex() defined in the BeanstalkController, and for defining a tube, you have to create a function called actionTubename($job). In PHP 5.6 or lower this gave no issue, but since PHP7, it notices that the function signature of actionIndex($job) is different in it's parent class (actionIndex($job)).

Maybe this behaviour should be documented to not use "index" as tube-name, since I don't think this is a easy fix without rewriting the beforeAction-function.

Sorry for very late return. Actually it is possible both on your controller extended from beanstalk
check if there is any tube and run another action does trick
else run parent::actionIndex