Skip to content
Snippets Groups Projects

Revert "Issue #3373694: Fix the issues reported by phpcs" partially

Closed Julian Pustkuchen requested to merge revert-98ba882a into 2.0.x
7 files
+ 76
95
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -6,16 +6,13 @@ use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Database\Connection;
use Drupal\Core\Datetime\DateFormatter;
use Drupal\Core\Form\FormBuilderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* The main controller for the module.
*/
class DevelDebugLogController extends ControllerBase {
/**
* The Database Connection.
* The Database Connection
*
* @var \Drupal\Core\Database\Connection
*/
@@ -24,7 +21,7 @@ class DevelDebugLogController extends ControllerBase {
/**
* The Serializer service.
*
* @var Symfony\Component\Serializer\Serializer
* @var Symfony\Component\Serializer\Serializer;
*/
protected $serializer;
@@ -38,7 +35,7 @@ class DevelDebugLogController extends ControllerBase {
/**
* The FormBuilder object.
*
* @var Drupal\Core\Form\FormBuilderInterface
* @var Drupal\Core\Form\FormBuilderInterface;
*/
protected $formBuilder;
@@ -57,14 +54,10 @@ class DevelDebugLogController extends ControllerBase {
/**
* DevelDebugLogController constructor.
*
* @param \Drupal\Core\Database\Connection $database
* The database object.
* @param \Drupal\Core\Datetime\DateFormatter $dateFormatter
* The dateFormatter object.
* @param \Symfony\Component\Serializer\Serializer $serializer
* The serializer object.
* @param \Drupal\Core\Form\FormBuilderInterface $formBuilder
* The formBuilder object.
* @param Connection $database
* @param DateFormatter $dateFormatter
* @param Serializer $serializer
* @param FormBuilderInterface $formBuilder
*/
public function __construct(Connection $database, DateFormatter $dateFormatter, Serializer $serializer, FormBuilderInterface $formBuilder) {
$this->database = $database;
@@ -77,7 +70,7 @@ class DevelDebugLogController extends ControllerBase {
* Lists debug information.
*
* @return array
* Renderable array that contains a list of debug data.
* Renderable array that contains a list of debug data.
*/
public function listLogs() {
$query = $this->database->select('devel_debug_log', 'm')
@@ -88,32 +81,31 @@ class DevelDebugLogController extends ControllerBase {
$rows = [];
foreach ($results as $result) {
$rows[] = [
$rows[] = array(
'title' => $result->title,
'time' => $this->dateFormatter
->format($result->timestamp, 'short'),
->format($result->timestamp, 'short'),
'message' => $result->message,
];
);
}
if (empty($rows)) {
return [
return array(
'#markup' => $this->t('No debug messages.'),
];
);
}
$build = [
'messages' => [
$build = array(
'messages' => array(
'#theme' => 'devel_debug_log_list',
'#content' => $rows,
'#delete_form' => $this->formBuilder->getForm('Drupal\devel_debug_log\Form\DevelDebugLogDeleteForm'),
],
'pager' => [
'#type' => 'pager',
],
];
),
'pager' => array(
'#type' => 'pager'
),
);
return $build;
}
}
Loading