Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default value for Job::input should be null #76

Open
Aerendir opened this issue May 4, 2019 · 0 comments
Open

The default value for Job::input should be null #76

Aerendir opened this issue May 4, 2019 · 0 comments

Comments

@Aerendir
Copy link
Owner

Aerendir commented May 4, 2019

Currently the signature is this:

public function __construct(string $command, $input = [], string $queue = Daemon::DEFAULT_QUEUE_NAME)

But the correct way of creating a new Job with input is this:

new Job('your:command', 'input-value --an-option', 'the_queue');

If the Job is created passing an array, the Job will behave wrongly.

So, the syntax required to create a new Job without input is a bit confusing:

new Job('your:command', [], 'the_queue');

It is better to use a null value:

new Job('your:command', null, 'the_queue');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant