Code Monkey home page Code Monkey logo

Comments (8)

ruudk avatar ruudk commented on June 19, 2024

A PR would be better :)

from php-resque.

danhunsaker avatar danhunsaker commented on June 19, 2024

The trouble with a pull request at this point is the question of why $args is being wrapped in an(other) array. Should it, instead, be cast to an array? Knowing why it is wrapped will determine which of the two solutions should be submitted in a PR to begin with.

from php-resque.

ruudk avatar ruudk commented on June 19, 2024

True, I found out this:

The encapsulated array() call in Job::create was added 2 years ago in order to be better compatible with the Ruby version: f7eac3b

When you look at Job->getArguments() you'll see that it then returns the first index of the array: https://github.com/chrisboulton/php-resque/blob/master/lib/Resque/Job.php#L128

So this should be correct:

return self::create($this->queue, $this->payload['class'], $this->payload['args'][0], $monitor);

from php-resque.

ruudk avatar ruudk commented on June 19, 2024

Maybe $this->getArguments() would be better as it returns an empty array when there are no arguments given. Where $this->payload['args'][0] could throw an undefined index error.

from php-resque.

danhunsaker avatar danhunsaker commented on June 19, 2024

You make it sound like git keeps a record of changes, and if commit messages are actually thoughtfully written, others can go back and see why things are done a certain way! A technology like that would be.... Well, useful.

Said another way: Oh. Right. The answer is probably in the commit history somewhere, and something like git blame would probably help narrow down where. Duh. Should have thought of that.

from php-resque.

CyrilMazur avatar CyrilMazur commented on June 19, 2024

yeah $this->getArguments() would be the proper way to do it, like you said, in case $this->payload['args'][0] is undefined. Pull request sent, thanks guys.

from php-resque.

Rockstar04 avatar Rockstar04 commented on June 19, 2024

It looks like this issue could be closed? Fixed in #104

from php-resque.

CyrilMazur avatar CyrilMazur commented on June 19, 2024

True @Rockstar04

from php-resque.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.