Loading modules/node_revision_generate/src/NodeRevisionGenerate.php +3 −3 Changes for modules/node_revision_generate/src/NodeRevisionGenerate.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ class NodeRevisionGenerate implements NodeRevisionGenerateInterface { /** * {@inheritdoc} */ public function getAvailableNodesForRevisions(array $bundles, $revisions_age): array { public function getAvailableNodesForRevisions(array $bundles, int $revisions_age): array { // Variable with the placeholders arguments needed for the expression. $interval_time = [ ':interval' => $revisions_age, Loading Loading @@ -83,7 +83,7 @@ class NodeRevisionGenerate implements NodeRevisionGenerateInterface { /** * {@inheritdoc} */ public function getRevisionCreationBatch(array $nodes_for_revisions, $revisions_number, $revisions_age): array { public function getRevisionCreationBatch(array $nodes_for_revisions, int $revisions_number, int $revisions_age): array { // Defining the batch builder. $batch_builder = new BatchBuilder(); $batch_builder->setTitle($this->t('Generating revisions')) Loading Loading @@ -116,7 +116,7 @@ class NodeRevisionGenerate implements NodeRevisionGenerateInterface { /** * {@inheritdoc} */ public function existsNodesContentType($content_type): bool { public function existsNodesContentType(string $content_type): bool { $query = $this->connection->select('node'); // Get the node id to generate revisions. $query->addField('node', 'nid'); Loading modules/node_revision_generate/src/NodeRevisionGenerateBatch.php +2 −2 Changes for modules/node_revision_generate/src/NodeRevisionGenerateBatch.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class NodeRevisionGenerateBatch { * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Core\Entity\EntityStorageException */ public static function generateRevisions($nid, $revision_date, &$context): void { public static function generateRevisions(int $nid, int $revision_date, &$context): void { if (empty($context['results'])) { $context['results']['revisions'] = 0; } Loading Loading @@ -54,7 +54,7 @@ class NodeRevisionGenerateBatch { * @param array $operations * The array of operations remained unprocessed. */ public static function finish($success, array $results, array $operations): void { public static function finish(bool $success, array $results, array $operations): void { $messenger = \Drupal::messenger(); $logger = \Drupal::logger('node_revision_generate'); Loading modules/node_revision_generate/src/NodeRevisionGenerateInterface.php +3 −3 Changes for modules/node_revision_generate/src/NodeRevisionGenerateInterface.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ interface NodeRevisionGenerateInterface { * Returns the available nodes ids to generate the revisions and its next * revision date. */ public function getAvailableNodesForRevisions(array $bundles, $revisions_age): array; public function getAvailableNodesForRevisions(array $bundles, int $revisions_age): array; /** * Return the revision creation batch definition. Loading @@ -41,7 +41,7 @@ interface NodeRevisionGenerateInterface { * @return array * The batch definition. */ public function getRevisionCreationBatch(array $nodes_for_revisions, $revisions_number, $revisions_age): array; public function getRevisionCreationBatch(array $nodes_for_revisions, int $revisions_number, int $revisions_age): array; /** * Returns if exists nodes of a content type. Loading @@ -52,6 +52,6 @@ interface NodeRevisionGenerateInterface { * @return bool * If exists nodes or not for a content type. */ public function existsNodesContentType($content_type): bool; public function existsNodesContentType(string $content_type): bool; } src/Commands/NodeRevisionDeleteCommands.php +13 −11 Changes for src/Commands/NodeRevisionDeleteCommands.php: 13 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ class NodeRevisionDeleteCommands extends DrushCommands { * * @param string $type * Content type machine name. * @param array $options * The options. * * @option dry_run Test run without deleting revisions but seeing the output. * Loading @@ -98,7 +100,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @command node-revision-delete * @aliases nrd */ public function nodeRevisionDelete($type, $options = ['dry_run' => FALSE]): void { public function nodeRevisionDelete(string $type, array $options = ['dry_run' => FALSE]): void { // Get all the candidate revisions. $candidate_revisions = $this->nodeRevisionDelete->getCandidatesRevisions($type); // Checking if this is a dry run. Loading @@ -114,7 +116,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { /** * Configures how many revisions delete per cron run. * * @param int $quantity * @param int|null $quantity * Revisions quantity to delete per cron run. * * @usage nrd-delete-cron-run Loading @@ -125,7 +127,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @command nrd:delete-cron-run * @aliases nrd-dcr, nrd-delete-cron-run */ public function deleteCronRun($quantity = NULL): void { public function deleteCronRun(?int $quantity = NULL): void { // Getting an editable config because we will get and set a value. $config = $this->configFactory->getEditable('node_revision_delete.settings'); // If no argument found? Loading Loading @@ -186,7 +188,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * * @throws \Drush\Exceptions\UserAbortException */ public function setTime($time = ''): void { public function setTime(string $time = ''): void { // Getting an editable config because we will get and set a value. $config = $this->configFactory->getEditable('node_revision_delete.settings'); Loading Loading @@ -240,9 +242,9 @@ class NodeRevisionDeleteCommands extends DrushCommands { * Configures the time options for the inactivity time that the revision must * have to be deleted. * * @param int $max_number * @param int|null $max_number * The maximum number for inactivity time configuration. * @param int $time * @param int|null $time * The time value for inactivity time configuration (days, weeks or months). * * @usage nrd-when-to-delete-time Loading @@ -255,7 +257,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @command nrd:when-to-delete-time * @aliases nrd-wtdt, nrd-when-to-delete-time */ public function whenToDeleteTime($max_number = NULL, $time = NULL): void { public function whenToDeleteTime(?int $max_number = NULL, ?int $time = NULL): void { // Getting an editable config because we will get and set a value. $config = $this->configFactory->getEditable('node_revision_delete.settings'); // Getting or setting values? Loading Loading @@ -292,9 +294,9 @@ class NodeRevisionDeleteCommands extends DrushCommands { * Configures time options to know the minimum age. that the revision must * have to be delete. * * @param int $max_number * @param int|null $max_number * The maximum number for minimum age configuration. * @param int $time * @param int|null $time * The time value for minimum age configuration (days, weeks or months). * * @usage nrd-minimum-age-to-delete-time Loading @@ -307,7 +309,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @command nrd:minimum-age-to-delete-time * @aliases nrd-matdt, nrd-minimum-age-to-delete-time */ public function minimumAgeToDeleteTime($max_number = NULL, $time = NULL): void { public function minimumAgeToDeleteTime(?int $max_number = NULL, ?int $time = NULL): void { // Getting an editable config because we will get and set a value. $config = $this->configFactory->getEditable('node_revision_delete.settings'); // Getting or setting values? Loading Loading @@ -356,7 +358,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ public function deletePriorRevisions($nid = 0, $vid = 0): void { public function deletePriorRevisions(?int $nid = 0, ?int $vid = 0): void { // Get list of prior revisions. $previousRevisions = $this->nodeRevisionDelete->getPreviousRevisions($nid, $vid); Loading src/Form/CandidateNodesForm.php +1 −1 Changes for src/Form/CandidateNodesForm.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ class CandidateNodesForm extends FormBase { /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state, NodeTypeInterface $node_type = NULL): array { public function buildForm(array $form, FormStateInterface $form_state, ?NodeTypeInterface $node_type = NULL): array { // Table header. $header = [ $this->t('Nid'), Loading Loading
modules/node_revision_generate/src/NodeRevisionGenerate.php +3 −3 Changes for modules/node_revision_generate/src/NodeRevisionGenerate.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ class NodeRevisionGenerate implements NodeRevisionGenerateInterface { /** * {@inheritdoc} */ public function getAvailableNodesForRevisions(array $bundles, $revisions_age): array { public function getAvailableNodesForRevisions(array $bundles, int $revisions_age): array { // Variable with the placeholders arguments needed for the expression. $interval_time = [ ':interval' => $revisions_age, Loading Loading @@ -83,7 +83,7 @@ class NodeRevisionGenerate implements NodeRevisionGenerateInterface { /** * {@inheritdoc} */ public function getRevisionCreationBatch(array $nodes_for_revisions, $revisions_number, $revisions_age): array { public function getRevisionCreationBatch(array $nodes_for_revisions, int $revisions_number, int $revisions_age): array { // Defining the batch builder. $batch_builder = new BatchBuilder(); $batch_builder->setTitle($this->t('Generating revisions')) Loading Loading @@ -116,7 +116,7 @@ class NodeRevisionGenerate implements NodeRevisionGenerateInterface { /** * {@inheritdoc} */ public function existsNodesContentType($content_type): bool { public function existsNodesContentType(string $content_type): bool { $query = $this->connection->select('node'); // Get the node id to generate revisions. $query->addField('node', 'nid'); Loading
modules/node_revision_generate/src/NodeRevisionGenerateBatch.php +2 −2 Changes for modules/node_revision_generate/src/NodeRevisionGenerateBatch.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class NodeRevisionGenerateBatch { * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Core\Entity\EntityStorageException */ public static function generateRevisions($nid, $revision_date, &$context): void { public static function generateRevisions(int $nid, int $revision_date, &$context): void { if (empty($context['results'])) { $context['results']['revisions'] = 0; } Loading Loading @@ -54,7 +54,7 @@ class NodeRevisionGenerateBatch { * @param array $operations * The array of operations remained unprocessed. */ public static function finish($success, array $results, array $operations): void { public static function finish(bool $success, array $results, array $operations): void { $messenger = \Drupal::messenger(); $logger = \Drupal::logger('node_revision_generate'); Loading
modules/node_revision_generate/src/NodeRevisionGenerateInterface.php +3 −3 Changes for modules/node_revision_generate/src/NodeRevisionGenerateInterface.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ interface NodeRevisionGenerateInterface { * Returns the available nodes ids to generate the revisions and its next * revision date. */ public function getAvailableNodesForRevisions(array $bundles, $revisions_age): array; public function getAvailableNodesForRevisions(array $bundles, int $revisions_age): array; /** * Return the revision creation batch definition. Loading @@ -41,7 +41,7 @@ interface NodeRevisionGenerateInterface { * @return array * The batch definition. */ public function getRevisionCreationBatch(array $nodes_for_revisions, $revisions_number, $revisions_age): array; public function getRevisionCreationBatch(array $nodes_for_revisions, int $revisions_number, int $revisions_age): array; /** * Returns if exists nodes of a content type. Loading @@ -52,6 +52,6 @@ interface NodeRevisionGenerateInterface { * @return bool * If exists nodes or not for a content type. */ public function existsNodesContentType($content_type): bool; public function existsNodesContentType(string $content_type): bool; }
src/Commands/NodeRevisionDeleteCommands.php +13 −11 Changes for src/Commands/NodeRevisionDeleteCommands.php: 13 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ class NodeRevisionDeleteCommands extends DrushCommands { * * @param string $type * Content type machine name. * @param array $options * The options. * * @option dry_run Test run without deleting revisions but seeing the output. * Loading @@ -98,7 +100,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @command node-revision-delete * @aliases nrd */ public function nodeRevisionDelete($type, $options = ['dry_run' => FALSE]): void { public function nodeRevisionDelete(string $type, array $options = ['dry_run' => FALSE]): void { // Get all the candidate revisions. $candidate_revisions = $this->nodeRevisionDelete->getCandidatesRevisions($type); // Checking if this is a dry run. Loading @@ -114,7 +116,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { /** * Configures how many revisions delete per cron run. * * @param int $quantity * @param int|null $quantity * Revisions quantity to delete per cron run. * * @usage nrd-delete-cron-run Loading @@ -125,7 +127,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @command nrd:delete-cron-run * @aliases nrd-dcr, nrd-delete-cron-run */ public function deleteCronRun($quantity = NULL): void { public function deleteCronRun(?int $quantity = NULL): void { // Getting an editable config because we will get and set a value. $config = $this->configFactory->getEditable('node_revision_delete.settings'); // If no argument found? Loading Loading @@ -186,7 +188,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * * @throws \Drush\Exceptions\UserAbortException */ public function setTime($time = ''): void { public function setTime(string $time = ''): void { // Getting an editable config because we will get and set a value. $config = $this->configFactory->getEditable('node_revision_delete.settings'); Loading Loading @@ -240,9 +242,9 @@ class NodeRevisionDeleteCommands extends DrushCommands { * Configures the time options for the inactivity time that the revision must * have to be deleted. * * @param int $max_number * @param int|null $max_number * The maximum number for inactivity time configuration. * @param int $time * @param int|null $time * The time value for inactivity time configuration (days, weeks or months). * * @usage nrd-when-to-delete-time Loading @@ -255,7 +257,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @command nrd:when-to-delete-time * @aliases nrd-wtdt, nrd-when-to-delete-time */ public function whenToDeleteTime($max_number = NULL, $time = NULL): void { public function whenToDeleteTime(?int $max_number = NULL, ?int $time = NULL): void { // Getting an editable config because we will get and set a value. $config = $this->configFactory->getEditable('node_revision_delete.settings'); // Getting or setting values? Loading Loading @@ -292,9 +294,9 @@ class NodeRevisionDeleteCommands extends DrushCommands { * Configures time options to know the minimum age. that the revision must * have to be delete. * * @param int $max_number * @param int|null $max_number * The maximum number for minimum age configuration. * @param int $time * @param int|null $time * The time value for minimum age configuration (days, weeks or months). * * @usage nrd-minimum-age-to-delete-time Loading @@ -307,7 +309,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @command nrd:minimum-age-to-delete-time * @aliases nrd-matdt, nrd-minimum-age-to-delete-time */ public function minimumAgeToDeleteTime($max_number = NULL, $time = NULL): void { public function minimumAgeToDeleteTime(?int $max_number = NULL, ?int $time = NULL): void { // Getting an editable config because we will get and set a value. $config = $this->configFactory->getEditable('node_revision_delete.settings'); // Getting or setting values? Loading Loading @@ -356,7 +358,7 @@ class NodeRevisionDeleteCommands extends DrushCommands { * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ public function deletePriorRevisions($nid = 0, $vid = 0): void { public function deletePriorRevisions(?int $nid = 0, ?int $vid = 0): void { // Get list of prior revisions. $previousRevisions = $this->nodeRevisionDelete->getPreviousRevisions($nid, $vid); Loading
src/Form/CandidateNodesForm.php +1 −1 Changes for src/Form/CandidateNodesForm.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ class CandidateNodesForm extends FormBase { /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state, NodeTypeInterface $node_type = NULL): array { public function buildForm(array $form, FormStateInterface $form_state, ?NodeTypeInterface $node_type = NULL): array { // Table header. $header = [ $this->t('Nid'), Loading