Skip to content
Snippets Groups Projects
Commit 27830602 authored by Shanu Chouhan's avatar Shanu Chouhan Committed by Antonín Slejška
Browse files

Issue #3360083 by Shanu Chouhan: Fix the issues reported by phpcs

parent cb816a64
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,8 @@ use Drupal\tsk\Services\TskService;
class TskCommands extends DrushCommands {
/**
* TskService.
*
* @var \Drupal\tsk\Services\TskService
*/
protected $tskService;
......@@ -40,14 +42,16 @@ class TskCommands extends DrushCommands {
/**
* Kills a temporary storage.
*
* @command temp-store-killer
* @aliases tsk
* @param string $type
* Type of the collection: private / shared
* Type of the collection: private / shared.
* @param string $collection
* The collection name to use for this key/value store.
* @param string $key
* The key of the stored data.
*
* @command temp-store-killer
* @aliases tsk
*
* @usage drush temp-store-killer type collection key
* Kills a temporary storage.
*/
......
......@@ -13,6 +13,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
class TskController extends ControllerBase {
/**
* Defines TskService.
*
* @var \Drupal\simple_sitemap\Simplesitemap
*/
protected $tskService;
......
......@@ -74,4 +74,5 @@ class TskEntity extends ConfigEntityBase implements TskEntityInterface {
* @var string
*/
public $key = NULL;
}
......@@ -44,10 +44,12 @@ class TskEntityDeleteForm extends EntityConfirmFormBase {
$tsk_entity->delete();
\Drupal::messenger()->addStatus($this->t('The entity %id was deleted successfully.', ['%id' => $tsk_entity->id]));
} catch (EntityStorageException $exception) {
}
catch (EntityStorageException $exception) {
\Drupal::messenger()->addError($this->t('The entity %id was not deleted.', ['%id' => $tsk_entity->id]));
}
// Set form redirection.
$form_state->setRedirectUrl($this->getCancelUrl());
}
}
......@@ -97,7 +97,7 @@ class TskEntityForm extends EntityForm {
'checked' => FALSE,
],
],
]
],
];
$query = $this->database->select('key_value_expire', 'kve');
......@@ -147,7 +147,8 @@ class TskEntityForm extends EntityForm {
$tsk_entity->save();
$this->messenger()->addStatus($this->t('The entity %id was saved successfully.', ['%id' => $tsk_entity->id]));
} catch (EntityStorageException $exception) {
}
catch (EntityStorageException $exception) {
$this->messenger()->addError($this->t('The entiy %id was not saved.', ['%id' => $tsk_entity->id]));
}
......
......@@ -78,7 +78,8 @@ class TskService {
if ($kill_all) {
$storage->deleteAll();
} else {
}
else {
$storage->delete($key);
}
}
......
......@@ -94,11 +94,11 @@ class TskEntityListBuilder extends ConfigEntityListBuilder {
];
$url->setOptions($url_options);
$build['kill_all_link'] = array(
$build['kill_all_link'] = [
'#type' => 'link',
'#url' => $url,
'#title' => t('Kill all'),
);
];
return $build;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment