File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -80,14 +80,23 @@ public function size($queue = null)
8080 * Push a new job onto the queue.
8181 *
8282 * @param string|object $job
83- * @param mixed $data
84- * @param string $queue
83+ * @param mixed $data
84+ * @param string $queue
8585 *
8686 * @return mixed
8787 */
8888 public function push ($ job , $ data = '' , $ queue = null )
8989 {
90- $ payload = $ this ->isPlain () ? $ job ->getPayload () : $ this ->createPayload ($ job , $ data );
90+ if ($ this ->isPlain ()) {
91+ return $ this ->pushRaw ($ job ->getPayload (), $ queue );
92+ }
93+
94+ $ reflection = new \ReflectionMethod ($ this , 'createPayload ' );
95+ if ($ reflection ->getNumberOfParameters () === 3 ) { // version >= 5.7
96+ $ payload = $ this ->createPayload ($ job , $ queue , $ data );
97+ } else {
98+ $ payload = $ this ->createPayload ($ job , $ data );
99+ }
91100
92101 return $ this ->pushRaw ($ payload , $ queue );
93102 }
You can’t perform that action at this time.
0 commit comments