diff --git a/core/lib/Drupal/Core/Batch/Batch.php b/core/lib/Drupal/Core/Batch/Batch.php index 688764c..03ee311 100644 --- a/core/lib/Drupal/Core/Batch/Batch.php +++ b/core/lib/Drupal/Core/Batch/Batch.php @@ -7,8 +7,8 @@ * * Example code to create a batch: * @code - * $batch = Batch::create('Batch Title') - * ->setTitle('Title can be changed.') + * $batch = Batch::create() + * ->setTitle('Batch Title') * ->setFinishCallback('batch_example_finished_callback') * ->setInitMessage('The initialization message (optional)'); * for ($i = 0; $i < 1000; $i++) { @@ -359,15 +359,15 @@ public function setProgressive($is_progressive = TRUE) { * @return $this */ public function setQueue($name, $class) { - if (is_null($name) && is_null($class)) { + if ($name === NULL && $class === NULL) { $this->queue = NULL; + return $this; } - else { - $this->queue = [ - 'name' => $name, - 'class' => $class, - ]; - } + + $this->queue = [ + 'name' => $name, + 'class' => $class, + ]; return $this; }