- Issue created by @Kamlesh Kishor Jha
- @kamlesh-kishor-jha opened merge request.
- 🇮🇳India Kamlesh Kishor Jha Jaipur
Created mr for this issue.
Please review this mr.
Thanks. - Issue was unassigned.
- Status changed to Needs work
over 1 year ago 4:08am 2 May 2023 - 🇵🇭Philippines paraderojether
Hi Kamlesh Kishor Jha
I reviewed MR!1, and confirmed the it fixes all the errors and warnings that you addressed. However, I'm getting these new errors and warnings shown below:
FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/menu_tree_compare/README.txt
---------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
33 | WARNING | Line exceeds 80 characters; contains 148 characters
---------------------------------------------------------------------------------------------------FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/menu_tree_compare/src/Form/MenuChoiceForm.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
9 | WARNING | [x] Unused use statement
10 | WARNING | [x] Unused use statement
27 | ERROR | [x] Missing function doc comment
31 | ERROR | [x] Missing function doc comment
50 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
56 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
62 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------FILE: /Users/studenttrainees/New/drupalorgsite/docroot/modules/contrib/menu_tree_compare/src/Controller/MenuTreeCompareController.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
270 | WARNING | Unused variable $key.
-------------------------------------------------------------------------------------------------------------------------------------Time: 352ms; Memory: 12MB
Please check.
Thank You. - Assigned to akshaydalvi212
- 🇮🇳India akshaydalvi212
I will resolve the remaining issues reported above.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 7:48am 2 May 2023 - @akshaydalvi212 opened merge request.
- Status changed to Needs work
over 1 year ago 8:01am 2 May 2023 - 🇮🇳India Mahima_Mathur23
Some of the comments needs more description like the Constructor of "MenuTreeCompareController" class.
- Status changed to Needs review
over 1 year ago 8:22am 2 May 2023 - 🇮🇳India ashutosh ahirwal India
Providing patch with solution
please review it. - Status changed to Needs work
over 1 year ago 10:49am 2 May 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+/** + * Class for MenuTreeCompareController. + */
The documentation comment for a class must not start with Class for followed by the class name. It must describe the class purpose.
+ /** + * {@inheritdoc} + */ public function __construct(MenuLinkTreeInterface $menu_link_tree, MenuLinkManagerInterface $menu_link_manager) {
{@inheritdoc}
is not used for class constructors.* @param string $from + * Return string value. * @param string $to + * Return string value.
A parameter description must not start with Return.
Also, the description must say what that parameter is, not what its type is.* @return mixed + * Return values */
The return value description must not start with Return.
That description is so vague that could be use for every return value./** + * Function isCompatiblePluginId(). + * * @param string $plugin_id + * Return string value. * * @return bool * Whether the plugin ID is supported.
The method descriptions must not start with Function nor repeat the method name.
The parameter description is not correct, for the same reason given earlier.- * @return array - * A render arrays.
The plural is not used with indefinite articles.
- Assigned to himanshu_jhaloya
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 11:08am 2 May 2023 - 🇮🇳India Mahima_Mathur23
@himanshu_jhaloya, Please work upon the previous patch and incorporate @apaderno's suggestions.
Otherwise we start from square one everytime. - Status changed to Needs work
over 1 year ago 7:21pm 3 May 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
@Mahima_Mathur23 is correct. The previous patch did not contain the following wrong change.
- /** @var \Drupal\Core\Menu\MenuLinkTreeElement $data */ - foreach ($tree as $key => $data) { + /** + * @var \Drupal\Core\Menu\MenuLinkTreeElement $data + * + */ + foreach ($tree as $data) {
In
/** @var \Drupal\Core\Menu\MenuLinkTreeElement $data */
there are two extra spaces, but that needs to be a single line.Eventually, the choice to only use the Drupal standard for the report could be questioned, but the patch should fix what reported by
phpcs --standard=Drupal
. - Assigned to akshaydalvi212
- 🇮🇳India akshaydalvi212
I will work on the MR as I raised at #7 and as suggested in #9 and #12 will update the MR accordingly.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 7:59am 5 May 2023 - 🇮🇳India akshaydalvi212
Kindly review the MR and sorry was not in a condition to work on it for the last 2-3 days.
- Status changed to Needs work
over 1 year ago 11:12am 5 May 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
-(function($, Drupal ) { +(function ($, Drupal ) { Drupal.behaviors.menu_tree_compare = {
There must not be spaces between the last argument and the closing parenthesis.
- var container_height = Math.max.apply( Math, [ left_height, right_height ] ) + 20; + var container_height = Math.max.apply( Math, [ left_height, right_height ] ) + 20;
Since that code is changed, the space before the first argument and before the last argument must be removed.
+/** + * Provides controller actions for compare and mapping of menus. + */
Since it uses mapping, it must also say comparing.
Also, it is not mapping of menus, but menu mapping.+ /** + * Constructs a MenuTreeCompareController object. + * + * @param \Drupal\Core\Menu\MenuLinkTreeInterface $menu_link_tree + * The menu link tree service. + * @param \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager + * The menu link manager service. + */ public function __construct(MenuLinkTreeInterface $menu_link_tree, MenuLinkManagerInterface $menu_link_manager) {
The short description is missing the class namespace.
/** - * Controller entry point. + * Summary of compare. * - * @param string $from - * @param string $to - * @return mixed + * @param mixed $from + * The from. + * @param mixed $to + * The to. + * + * @return array + * It will return array. */ public function compare($from, $to) {
Short descriptions must not start with Summary of.
The parameter descriptions are wrong.
The return value description must describe the return value, not its type. They must not start with It will return./** + * Summary of isCompatiblePluginId.. + * * @param string $plugin_id + * The plugin id.
The short description is wrong for the same reason the previous short description is wrong. It also ends with two periods instead of one.
id is misspelled, since the correct spelling is ID./** - * Returns an output structure for rendering a menu tree. + * Summary of enrichMenuTree.
The existing description is already correct. Eventually, it could be changed to Renders a menu tree.
* @param array $tree - * A structure representing the tree as returned from MenuLinkTreeInterface::build(). + * The tree.
The existing description is already correct.
- * The mapping of items on the left and on the right. - * - * @return array - * A render arrays. - * - * @see MenuLinkTreeInterface::build() + * The mapping. */
The return value description cannot be removed. Eventually it needs to be corrected, since A must be followed by a singular word. (arrays is a plural word.)
The parameter description is already correct.+ /** + * Constructs a \Drupal\system\ConfigFormBase object. + * + * @param \Drupal\Core\Entity\EntityTypeManager $entity_type_manager + * The entity type manager service. + */ public function __construct(EntityTypeManager $entity_type_manager) {
Since that is the
MenuChoiceForm
constructor, it cannot construct a\Drupal\system\ConfigFormBase
object. - 🇮🇹Italy apaderno Brescia, 🇮🇹
Also, the report given in the issue summary is for the following files.
- js/menu_tree_compare.js
- menu_tree_compare.css
- src/Controller/MenuTreeCompareController.php
- src/Form/MenuChoiceForm.php
The MR is changing the following files.
- README.txt
- js/menu_tree_compare.js
- menu_tree_compare.css
- src/Controller/MenuTreeCompareController.php
- src/Form/MenuChoiceForm.php
The report does show anything for the README.txt file.
- 🇩🇰Denmark ressa Copenhagen
Manually attaching patches is being phased out, and you should create a patch and Merge Request with the Gitlab integration.
DrupalCI and all patch testing will be turned off on July 1, 2024 →