Repository navigation
Expand file tree
/
Copy pathclean_code.module
More file actions
41 lines (34 loc) · 1.8 KB
/
Copy pathclean_code.module
File metadata and controls
41 lines (34 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* @file
* Provides help and documentation for the Clean Code module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function clean_code_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.clean_code':
$output = '';
// About section.
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('<a href=":cleancode">Clean Code</a>integrates GrumPHP into Drupal project to enforce coding standards and perform code quality checks. It provides Drush commands to generate and manage GrumPHP configuration, ensuring your codebase stays clean and adheres to best practices.',
[
':cleancode' => 'http://drupal.org/project/clean_code',
]
) . '</p>';
// Uses section.
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<p>' . t('The Clean Code module helps keep your codebase clean by running automated checks. You can configure which coding standards to enforce and define task-specific options, ensuring your code follows best practices.') . '</p>';
// Drush Commands section.
$output .= '<h3>' . t('Drush Commands') . '</h3>';
$output .= '<p>' . t('You can manage the GrumPHP setup using the following Drush commands:') . '</p>';
$output .= '<ul>';
$output .= '<li>' . t('<code>drush clean_code:check</code>: Run GrumPHP checks on your code.') . '</li>';
$output .= '<li>' . t('<code>drush clean_code:generate-install</code>: Generate and install the necessary GrumPHP configuration files.') . '</li>';
$output .= '<li>' . t('<code>drush clean_code:generate-no-install</code>: Generate GrumPHP configuration without installing the necessary packages.') . '</li>';
$output .= '</ul>';
return $output;
}
}