- Issue created by @samit.310@gmail.com
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 4:19am 17 March 2023 - Status changed to Needs work
over 1 year ago 8:59am 17 March 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+/** + * @file + * Contains printjs.module. + */ +
That is not the description for a .module file that is normally used. It does not even make sense, as it says that printjs.module contain printjs.module.
+ /** + * Constructs a new PrintJsBlock object. + *
The namespace is missing.
+ * @param array $configuration + * A configuration array containing information about the plugin instance.
Probably the article should be different.
- First commit to issue fork.
- @kkalashnikov opened merge request.
- Status changed to Needs review
over 1 year ago 7:13am 21 March 2023 - Status changed to Needs work
over 1 year ago 8:15am 21 March 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+/** + * @file + * Provides hooks and alters for printjs. + */
The usual comment is Hook implementations for [module name].
+ +/** + * Implements hook_help(). + */ +function printjs_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the printjs module. + case 'help.page.printjs': + $output = '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Print content in with id use library + <a href="https://printjs.crabbly.com/">https://printjs.crabbly.com/</a> + you can define id which one you want to print, by default its id="print" + <div id="print"> Print me</div> + How to use:') . '</p>'; + $output .= '<ul><li>' . t('You can create your content into div id="print" add Printjs block, it will show print button it will send content in id=print + css of page to printer') . '</li>'; + $output .= '<li>' . t('You can add print button in header or footer of views') . '</li>'; + $output .= '<li>' . t('You can customize your button print to print pdf, image, json ... like <a href="https://printjs.crabbly.com/ ">https://printjs.crabbly.com</a>with hook_preprocess_printjs') . '</li>'; + $output .= '</ul>'; + return $output; + + default: + break; + } +}
The
phpcs
report shown in the issue summary does not sayhook_help()
needs to be implemented. That is a change for a different issue.+ /** + * Creates a new PrintJsBlock. + * + * @param array $configuration
The class name does not include its namespace.
- @kkalashnikov opened merge request.
- Status changed to Needs review
over 1 year ago 6:35am 31 March 2023 - Status changed to Needs work
over 1 year ago 7:13am 31 March 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+/** + * @file + * Hook implementation for the printjs module. + */
The module name is not printjs. Do not get confused between module machine name and module name, since those are different.
Also, it is Hook implementations, since a module file generally contains more than a single hook implementation; even in the case there is just a hook, the plural is always used.+ /** + * Creates a PrintJs Block. + * + * @param array $configuration + * An associative array containing the plugin's configuration. + * @param string $plugin_id + * The plugin_id for the plugin instance. + * @param string $plugin_definition + * The plugin implementation definition. + * @param \Drupal\printjs\Printjs $print_js + * The Print Js service.
+ /** + * The Printjs constructor. + * + * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory + * The config factory. + * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation + * Injected service. + */ + public function __construct(ConfigFactoryInterface $configFactory, TranslationInterface $string_translation) { + $this->configFactory = $configFactory;
The class name and its namespace are missing from the short description.
The usual comment is "Constructs a new [class name] object." - Assigned to shalini_jha
- Issue was unassigned.
- @shalini_jha opened merge request.
- Status changed to Needs review
over 1 year ago 11:30am 12 April 2023 - Status changed to Needs work
over 1 year ago 7:20pm 16 April 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+/** + * @file + * Contains printjs.module. + */
That is not the documentation comment used for modules. See comment #12 for the correct documentation comment, which the previous MR was almost providing.
+/** + * Implements hook_help(). + */ +function printjs_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the printjs module. + case 'help.page.printjs': + $output = '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Print content in with id use library + <a href="https://printjs.crabbly.com/">https://printjs.crabbly.com/</a> + you can define id which one you want to print, by default its id="print" + <div id="print"> Print me</div> + How to use:') . '</p>'; + $output .= '<ul><li>' . t('You can create your content into div id="print" add Printjs block, it will show print button it will send content in id=print + css of page to printer') . '</li>'; + $output .= '<li>' . t('You can add print button in header or footer of views') . '</li>'; + $output .= '<li>' . t('You can customize your button print to print pdf, image, json ... like <a href="https://printjs.crabbly.com/ ">https://printjs.crabbly.com</a>with hook_preprocess_printjs') . '</li>'; + $output .= '</ul>'; + return $output; + + default: + break; + } +} +
The report in the issue summary does not say that hook must be implemented. This issue is for fixed what reported by PHP_CodeSniffer; other changes are off-topic for this issue, except in the case of lines already changed for what PHP_CodeSniffer reports.
+ /** + * Constructs a new PrintJs object using the provided configuration and + * string translation services. *
The class name does not include its namespace.
using the provided configuration and string translation services is not necessary and it is not used for constructors documentation comments.
There are trailing spaces and an extraneous asterisk.+ /** + * The Printjs constructor. + *
The class namespace is missing.
- Status changed to Fixed
over 1 year ago 2:45pm 18 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.