- Issue created by @Harshita mehra
- Status changed to Needs review
12 months ago 12:04pm 29 June 2023 - last update
12 months ago 9 pass - ๐ฎ๐ณIndia Harshita mehra
I have provided a patch to fix this issue.
Please review it. - ๐ฎ๐ณIndia arpitk
I reviewed the patch #2. It applied cleanly and no error/warning related to phpcs Drupal are produced. How ever this issue is about fixing phpcs issues so all issues can be taken care in single issue no need to create different issues. like https://www.drupal.org/project/menu_trail_by_path/issues/3371326 ๐ Replace the t() calls to $this->t() in classes. Needs review
Thanks!
- Status changed to RTBC
12 months ago 3:37pm 29 June 2023 - ๐ฎ๐ณIndia Priya_Degwekar
Hi @Harshita mehna, Verified and Tested #2 ๐ Fix the issues reported by phpcs Needs work .
It's working fine. - Status changed to Needs work
11 months ago 10:18am 20 July 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
/** + * Template File Doc Comment. + * * @var \Drupal\Core\Path\PathValidatorInterface */ - protected $pathValidator;
/** + * Template File Doc Comment. + * * @var \Drupal\Core\Routing\RequestContext */ protected $context;
/** + * Template File Doc Comment. + * * @var \Drupal\Core\Language\LanguageManagerInterface */
Those are not property descriptions. (The fact the same phrase is repeated for three different properties of the same class should suggest that phrase does not describe those properties.)
* @param \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager + * Managing menu links and storing their definitions. * @param \Drupal\Core\Routing\RouteMatchInterface $route_match + * Provides an interface for classes representing the result of routing. * @param \Drupal\Core\Cache\CacheBackendInterface $cache + * Defines an interface for cache implementations. * @param \Drupal\Core\Lock\LockBackendInterface $lock + * Lock backend interface. * @param \Drupal\Core\Path\PathValidatorInterface $path_validator + * Provides an interface for URL path validators. * @param \Drupal\Core\Routing\RequestContext $context + * Provides a fluent interface. * @param \Drupal\Core\Language\LanguageManagerInterface $languageManager + * Common interface for the language manager service. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * Defines the interface for a configuration object factory.
Those are not correct descriptions to use with parameters. I would suggest to check the parameter descriptions used for Drupal core classes. In most of the cases, there is no need to use a different description.
For example, it is not Defines the interface for a configuration object factory. (since an object does not define an interface, but implements an interface), but The config factory.- * @return \Drupal\Core\Menu\MenuLinkInterface|NULL - * The menu link for the given menu, or NULL if there is no matching menu link. + * @return \Drupal\Core\Menu\MenuLinkInterface|null + * The menu linkร refers to the given menu, or NULL if none exists. */
The existing description is already correct.
- * NOTE: There is a difference between $this->routeMatch->getRouteName and $this->context->getPathInfo() - * for now it seems more logical to prefer the latter, because that's the "real" url that visitors enter in their browser.. + * NOTE: There is a difference between: + * $this->routeMatch->getRouteName and $this->context->getPathInfo()
The period at the end is missing. NOTE must be spelled Note and the colons after Note and between must be removed.
+ * for now it seems more logical to prefer the latter, + * because that's the "real" url that visitors enter + * in their browser.
For must be capitalized and url spelled URL.
* @return \Drupal\Core\Url|null + * A string containing a URL that may be used to access the file.
The description must also say when
NULL
is returned./** - * Array key's should be the menu title's, if multi-level than separated by ' รยป '. + * Array key's should be the menu title's. * - * @var Url[] + * If multi-level than separated by ' รยป '. + * + * @var \Drupal\Core\Url[] */ protected $menuUrls = [];
The description does not describe the property.
/** + * Provides an interface defining a user entity. + * * @var \Drupal\user\UserInterface */ protected $authenticatedUser;
A property does not provide interfaces; eventually, an object implements interfaces, but that does not say what that property contains.
- // Create user + // Create user. $this->authenticatedUser = $this->drupalCreateUser();
That comment can be removed, since there is no need to explain what
$this->drupalCreateUser()
does; the method name explains itself.- // Create content type - $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); + // Create content type. + $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); - // Create nodes + // Create nodes. $home = $this->drupalCreateNode(); $this->createPathAlias('/node/' . $home->id(), '/home');
The same holds true for those comments.
/** - * Test url: Home + * Test url: Home. */ public function testUrlHome() { $this->drupalGet(clone $this->menuUrls['Home']); @@ -111,7 +115,7 @@ class MenuTrailByPathActiveTrailHtmlClassTest extends BrowserTestBase { } /** - * Test url: User password + * Test url: User password. */ public function testUrlUserPassword() { $this->drupalGet(clone $this->menuUrls['User password']); @@ -156,7 +160,7 @@ class MenuTrailByPathActiveTrailHtmlClassTest extends BrowserTestBase { } /** - * Test url: User login + * Test url: User login.
That is the minimum required change. Test url: User login should be Test the user login URL. Similar change must be done for the other comments.
- // Also test the parent item, due to the tree url key construction of assertMenuActiveTrail we need two separate calls + // Also test the parent item, due to the tree url key + // construction of assertMenuActiveTrail we need two separate calls.
The correct sentence is Also test the parent item; due to the tree URL key construction of assertMenuActiveTrail, we need two separate calls.
/** - * Build a menu with the data of $this->menuUrls + * Build a menu with the data of $this->menuUrls. * * @param string $menu_name + * Build a menu. */ protected function buildMenu($menu_name = 'main') {
Build in the method description must be Builds.
Build a menu is not a parameter description: A parameter does not build anything.
The return value description is missing./** - * Helper for getting the base: "link_path" that assertMenuActiveTrail expects. + * Helper for getting the base:"link_path" that assertMenuActiveTrail expects.
It is the base link path that.
+ * @param string $name + * Specifies the URL for all relative URLs in the page.
Specifies is not necessary.
- Assigned to imustakim
- Merge request !93371317-fix-the-issues: Resolved all the issue related to phpcs. โ (Open) created by imustakim
- last update
11 months ago 9 pass - Issue was unassigned.
- Status changed to Needs review
11 months ago 2:30pm 28 July 2023 - ๐ฎ๐ณIndia imustakim Ahmedabad
Addressed all the suggestion mentioned in #8 ๐ Fix the issues reported by phpcs Needs work .
Please review the MR. - Status changed to RTBC
11 months ago 4:24pm 28 July 2023 - ๐ต๐ญPhilippines roberttabigue
Hi,
I applied the latest MR !8 to the Menu Trail By Path module against 2.x-dev on Drupal 9.5.10 and confirmed all PHPCS errors have been fixed.
I ran this command on the module:
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml menu_trail_by_path/
Please see the attached files for reference.
I'm moving this now to RTBC.
Thank you!
- Status changed to Needs work
11 months ago 11:59am 29 July 2023 - First commit to issue fork.
- last update
11 months ago 9 pass - ๐ฎ๐ณIndia Preethy_ray
pray_12 โ made their first commit to this issueโs fork.
- last update
5 months ago 9 pass - Status changed to Needs review
5 months ago 12:32pm 8 February 2024