49 public function newJob(
string $command, $params = [] ):
Job {
50 if ( !isset( $this->jobObjectSpecs[ $command ] ) ) {
51 throw new InvalidArgumentException(
"Invalid job command '{$command}'" );
54 $spec = $this->jobObjectSpecs[ $command ];
55 $needsTitle = $this->needsTitle( $command, $spec );
60 $title = Title::newFromPageReference( $params );
61 $params = func_num_args() >= 3 ? func_get_arg( 2 ) : [];
62 } elseif ( isset( $params[
'namespace'] ) && isset( $params[
'title'] ) ) {
66 $title = Title::makeTitle(
75 $title = Title::makeTitle(
88 $job = $this->objectFactory->createObject(
91 'allowClassName' =>
true,
92 'allowCallable' =>
true,
94 'assertClass' => Job::class
99 $job->command = $command;